@@ -765,11 +765,10 @@ struct
765
765
| Ldot (_left , name ) -> name
766
766
| Lapply (_ , _ ) -> assert false
767
767
768
- let addForField recordType item {Asttypes. txt; loc} =
768
+ let addForField recordType fieldType {Asttypes. txt; loc} =
769
769
match (Shared. dig recordType).desc with
770
770
| Tconstr (path , _args , _memo ) ->
771
771
let t = getTypeAtPath ~env path in
772
- let {Types. lbl_res} = item in
773
772
let name = handleConstructor txt in
774
773
let nameLoc = Utils. endOfLocation loc (String. length name) in
775
774
let locType =
@@ -785,7 +784,7 @@ struct
785
784
GlobalReference (moduleName, path, Field name)
786
785
| _ -> NotFound
787
786
in
788
- addLocItem extra nameLoc (Typed (name, lbl_res , locType))
787
+ addLocItem extra nameLoc (Typed (name, fieldType , locType))
789
788
| _ -> ()
790
789
791
790
let addForRecord recordType items =
@@ -1004,8 +1003,8 @@ struct
1004
1003
()
1005
1004
| Texp_construct (lident , constructor , _args ) ->
1006
1005
addForConstructor expression.exp_type lident constructor
1007
- | Texp_field (inner , lident , label_description ) ->
1008
- addForField inner.exp_type label_description lident
1006
+ | Texp_field (inner , lident , _label_description ) ->
1007
+ addForField inner.exp_type expression.exp_type lident
1009
1008
| Texp_let (_ , _ , _ ) ->
1010
1009
(* TODO this scope tracking won't work for recursive *)
1011
1010
addScopeExtent expression.exp_loc
0 commit comments