File tree 2 files changed +9
-2
lines changed
testsuite/tests/typing-layouts
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -327,3 +327,10 @@ and t2 = Mk1 of t_void t | Mk2
327
327
type ('b : void) t = 'b void_t * t2
328
328
and t2 = Mk1 of t_void t | Mk2
329
329
|}]
330
+
331
+ type 'a t8_5 = { x : 'a t8_6 ; y : string }
332
+ and 'a t8_6 = 'a void_t ;;
333
+ [%% expect {|
334
+ type ('a : void) t8_5 = { x : 'a t8_6 ; y : string ; }
335
+ and ('a : void) t8_6 = 'a void_t
336
+ |}]
Original file line number Diff line number Diff line change @@ -1499,6 +1499,8 @@ let transl_type_decl env rec_flag sdecl_list =
1499
1499
raise (Error (loc, Type_clash (new_env, err))))
1500
1500
checks)
1501
1501
delayed_layout_checks;
1502
+ (* Check that constraints are enforced *)
1503
+ List. iter2 (check_constraints new_env) sdecl_list decls;
1502
1504
(* Check that all type variables are closed; this also defaults any remaining
1503
1505
sort variables. Defaulting must happen before update_decls_layout,
1504
1506
Typedecl_seperability.update_decls, and add_types_to_env, all of which need
@@ -1512,8 +1514,6 @@ let transl_type_decl env rec_flag sdecl_list =
1512
1514
Some ty -> raise(Error (sdecl.ptype_loc, Unbound_type_var (ty,decl)))
1513
1515
| None -> () )
1514
1516
sdecl_list tdecls;
1515
- (* Check that constraints are enforced *)
1516
- List. iter2 (check_constraints new_env) sdecl_list decls;
1517
1517
(* Add type properties to declarations *)
1518
1518
let decls =
1519
1519
try
You can’t perform that action at this time.
0 commit comments