diff options
-rw-r--r-- | typing/typetexp.ml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/typing/typetexp.ml b/typing/typetexp.ml index 8c954e4f4..5171adf1b 100644 --- a/typing/typetexp.ml +++ b/typing/typetexp.ml @@ -248,7 +248,7 @@ let rec transl_type env policy styp = end; ty with Not_found -> - begin_def (); + if !Clflags.principal then begin_def (); let t = newvar () in used_variables := Tbl.add alias (t, styp.ptyp_loc) !used_variables; let ty = transl_type env policy st in @@ -256,8 +256,10 @@ let rec transl_type env policy styp = let trace = swap_list trace in raise(Error(styp.ptyp_loc, Alias_type_mismatch trace)) end; - end_def (); - generalize_structure t; + if !Clflags.principal then begin + end_def (); + generalize_structure t; + end; instance t end | Ptyp_variant(fields, closed, present) -> |