@@ -21,18 +21,17 @@ let (modtype_fmt, flush_modtype_fmt, modtype_set_margin) = new_fmt ()
2121
2222let string_of_type_expr ?(margin = default_margin) t =
2323 type_set_margin margin;
24- Printtyp. mark_loops t;
25- Printtyp. type_scheme_max ~b_reset_names: false type_fmt t;
24+ Printtyp. shared_type_scheme type_fmt t;
2625 flush_type_fmt ()
2726
2827let raw_string_of_type_list ?(margin = default_margin) sep type_list =
2928 let buf = Buffer. create 256 in
3029 let fmt = Format. formatter_of_buffer buf in
3130 Format. pp_set_margin fmt margin;
3231 let rec need_parent t =
33- match t. Types. desc with
32+ match Types. get_desc t with
3433 Types. Tarrow _ | Types. Ttuple _ -> true
35- | Types. Tlink t2 | Types. Tsubst t2 -> need_parent t2
34+ | Types. Tlink t2 | Types. Tsubst ( t2 , _ ) -> need_parent t2
3635 | Types. Tconstr _ ->
3736 false
3837 (* | Types.Tvar | Types.Tunivar | Types.Tobject _ | Types.Tpoly _ *)
@@ -41,17 +40,16 @@ let raw_string_of_type_list ?(margin = default_margin) sep type_list =
4140 | _ -> false
4241 in
4342 let print_one_type variance t =
44- Printtyp. mark_loops t;
4543 if need_parent t then
4644 (
4745 Format. fprintf fmt " (%s" variance;
48- Printtyp. type_scheme_max ~b_reset_names: false fmt t;
46+ Printtyp. shared_type_scheme fmt t;
4947 Format. fprintf fmt " )"
5048 )
5149 else
5250 (
5351 Format. fprintf fmt " %s" variance;
54- Printtyp. type_scheme_max ~b_reset_names: false fmt t
52+ Printtyp. shared_type_scheme fmt t
5553 )
5654 in
5755 begin match type_list with
@@ -118,9 +116,9 @@ let string_of_class_type_param_list ?margin l =
118116 (if par then " ]" else " " )
119117
120118let rec is_arrow_type t =
121- match t. Types. desc with
119+ match Types. get_desc t with
122120 Types. Tarrow _ -> true
123- | Types. Tlink t2 | Types. Tsubst t2 -> is_arrow_type t2
121+ | Types. Tlink t2 | Types. Tsubst ( t2 , _ ) -> is_arrow_type t2
124122 (* | Types.Ttuple _ *)
125123 (* | Types.Tconstr _ *)
126124 (* | Types.Tvar | Types.Tunivar | Types.Tobject _ | Types.Tpoly _ *)
@@ -140,7 +138,6 @@ let string_of_class_params ?(margin = default_margin) c =
140138 Odoc_misc. remove_option t
141139 else
142140 t in
143- Printtyp. mark_loops t;
144141 Format. fprintf fmt " @[<hov 2>%s%s%a%s@] ->@ "
145142 (
146143 match label with
@@ -149,7 +146,7 @@ let string_of_class_params ?(margin = default_margin) c =
149146 | Asttypes. Optional s -> " ?" ^ s^ " :"
150147 )
151148 (if parent then " (" else " " ) (* TODO open_box ?*)
152- (Printtyp. type_scheme_max ~b_reset_names: false ) ty
149+ (Printtyp. shared_type_scheme ) ty
153150 (if parent then " )" else " " );
154151 iter ctype
155152 | Types. Cty_signature _
0 commit comments