@@ -101,22 +101,20 @@ module Cache = struct
101101 let find_ty id =
102102 HT. find ae_ty_ht (Id id)
103103
104- let fresh_ty ?(is_var = true ) ?id () =
104+ let fresh_ty ?(is_var = true ) ?( name = None ) () =
105105 if is_var
106106 then Ty. fresh_tvar ()
107107 else
108- match id with
109- | Some id -> Ty. text [] (Uid. of_string id )
108+ match name with
109+ | Some n -> Ty. text [] (Uid. of_string n )
110110 | None -> Ty. fresh_empty_text ()
111111
112- let show (type a ) (id : a DE.id ) = Fmt. to_to_string DE.Id. print id
113-
114- let update_ty_store ?(is_var = true ) id =
115- let ty = fresh_ty ~is_var ~id: (show id) () in
112+ let update_ty_store ?(is_var = true ) ?name id =
113+ let ty = fresh_ty ~is_var ~name () in
116114 store_ty id ty
117115
118- let update_ty_store_ret ?(is_var = true ) id =
119- let ty = fresh_ty ~is_var ~id: (show id) () in
116+ let update_ty_store_ret ?(is_var = true ) ? name id =
117+ let ty = fresh_ty ~is_var ~name () in
120118 store_ty id ty;
121119 ty
122120
@@ -127,7 +125,8 @@ module Cache = struct
127125 update_ty_store_ret ~is_var id
128126
129127 let store_tyv ?(is_var = true ) t_v =
130- update_ty_store ~is_var t_v
128+ let name = get_basename t_v.DE. path in
129+ update_ty_store ~is_var ~name t_v
131130
132131 let store_tyvl ?(is_var = true ) (tyvl : DE.ty_var list ) =
133132 List. iter (store_tyv ~is_var ) tyvl
@@ -587,10 +586,11 @@ and handle_ty_app ?(update = false) ty_c l =
587586let mk_ty_decl (ty_c : DE.ty_cst ) =
588587 match DT. definition ty_c with
589588 | Some (
590- Adt { cases = [| { cstr = { id_ty; _ } as cstr; dstrs; _ } |]; _ }
589+ ( Adt { cases = [| { cstr = { id_ty; _ } as cstr; dstrs; _ } |]; _ } as adt)
591590 ) ->
592591 (* Records and adts that only have one case are treated in the same way,
593592 and considered as records. *)
593+ Nest. attach_orders [adt];
594594 let uid = Uid. of_ty_cst ty_c in
595595 let tyvl = Cache. store_ty_vars_ret id_ty in
596596 let rev_lbs =
@@ -613,8 +613,8 @@ let mk_ty_decl (ty_c: DE.ty_cst) =
613613 Cache. store_ty ty_c ty
614614
615615 | Some (Adt { cases; _ } as adt ) ->
616- let uid = Uid. of_ty_cst ty_c in
617616 Nest. attach_orders [adt];
617+ let uid = Uid. of_ty_cst ty_c in
618618 let tyvl = Cache. store_ty_vars_ret cases.(0 ).cstr.id_ty in
619619 Cache. store_ty ty_c (Ty. t_adt uid tyvl);
620620 let rev_cs =
0 commit comments