Skip to content

Commit b21c8ba

Browse files
committed
Improve type definitions location
1 parent 2dcfaa6 commit b21c8ba

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/ocaml/typing/typemod.ml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2651,17 +2651,19 @@ and type_structure ?(toplevel = false) ?(keep_warnings = false) funct_body ancho
26512651
(fun rs info -> Sig_type(info.typ_id, info.typ_type, rs, Exported))
26522652
decls []
26532653
in
2654-
let shape_map = List.fold_left
2655-
(fun shape_map -> function
2656-
| Sig_type (id, vd, _, _) ->
2654+
let shape_map = List.fold_left2
2655+
(fun shape_map sig_item type_decl ->
2656+
match sig_item with
2657+
| Sig_type (id, td, _, _) ->
26572658
if not (Btype.is_row_name (Ident.name id)) then begin
2658-
Env.register_uid vd.type_uid vd.type_loc;
2659-
Shape.Map.add_type shape_map id vd.type_uid
2659+
Env.register_uid td.type_uid type_decl.typ_name.loc;
2660+
Shape.Map.add_type shape_map id td.type_uid
26602661
end else shape_map
26612662
| _ -> assert false
26622663
)
26632664
shape_map
26642665
items
2666+
decls
26652667
in
26662668
Tstr_type (rec_flag, decls),
26672669
items,

0 commit comments

Comments
 (0)