@@ -765,11 +765,10 @@ struct
765765 | Ldot (_left , name ) -> name
766766 | Lapply (_ , _ ) -> assert false
767767
768- let addForField recordType item {Asttypes. txt; loc} =
768+ let addForField recordType fieldType {Asttypes. txt; loc} =
769769 match (Shared. dig recordType).desc with
770770 | Tconstr (path , _args , _memo ) ->
771771 let t = getTypeAtPath ~env path in
772- let {Types. lbl_res} = item in
773772 let name = handleConstructor txt in
774773 let nameLoc = Utils. endOfLocation loc (String. length name) in
775774 let locType =
@@ -785,7 +784,7 @@ struct
785784 GlobalReference (moduleName, path, Field name)
786785 | _ -> NotFound
787786 in
788- addLocItem extra nameLoc (Typed (name, lbl_res , locType))
787+ addLocItem extra nameLoc (Typed (name, fieldType , locType))
789788 | _ -> ()
790789
791790 let addForRecord recordType items =
@@ -1004,8 +1003,8 @@ struct
10041003 ()
10051004 | Texp_construct (lident , constructor , _args ) ->
10061005 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
10091008 | Texp_let (_ , _ , _ ) ->
10101009 (* TODO this scope tracking won't work for recursive *)
10111010 addScopeExtent expression.exp_loc
0 commit comments