Problem
When using @type annotation to explicitly specify a type, the type inference from assignment statement overrides the annotation type.
Reproduction
---@type ThunderStrikeInviteDataStruct
self.inviteData = nil -- inferred as nil instead of ThunderStrikeInviteDataStruct
---@type _obj_inviteItem._obj_heroHeadItem_GoTable[]
self.guardObjList = {} -- inferred as table instead of the specified array type
Expected Behavior
When @type annotation is used, it should take priority over type inference.
Root Cause
In the bind_type function (crates/emmylua_code_analysis/src/compilation/analyzer/common/mod.rs), when an existing type exists, new types are processed through merge_def_type, but it does not properly handle the priority relationship between DocType and InferType.
Problem
When using @type annotation to explicitly specify a type, the type inference from assignment statement overrides the annotation type.
Reproduction
Expected Behavior
When @type annotation is used, it should take priority over type inference.
Root Cause
In the bind_type function (crates/emmylua_code_analysis/src/compilation/analyzer/common/mod.rs), when an existing type exists, new types are processed through merge_def_type, but it does not properly handle the priority relationship between DocType and InferType.