File tree 2 files changed +11
-6
lines changed
2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -1112,8 +1112,8 @@ module Layout_and_axes = struct
1112
1112
match jkind_of_type wb_ty with
1113
1113
| None -> Mod_bounds. max
1114
1114
| Some jkind ->
1115
- (! normalize' jkind (* CR aspsmith: unbound_type_vars? *)
1116
- ~mode: Ignore_best ~ jkind_of_type )
1115
+ (! normalize' jkind ~ unbound_type_vars ~mode: Ignore_best
1116
+ ~jkind_of_type )
1117
1117
.jkind
1118
1118
.mod_bounds
1119
1119
in
@@ -2235,13 +2235,12 @@ let for_object =
2235
2235
(* *****************************)
2236
2236
(* elimination and defaulting *)
2237
2237
2238
- let [@ inline] normalize ?(unbound_type_vars = Btype.TypeSet. empty) ~mode
2239
- ~jkind_of_type t =
2238
+ let [@ inline] normalize ?unbound_type_vars ~mode ~jkind_of_type t =
2240
2239
let mode : _ Layout_and_axes.normalize_mode =
2241
2240
match mode with Require_best -> Require_best | Ignore_best -> Ignore_best
2242
2241
in
2243
2242
let jkind, fuel_result =
2244
- Layout_and_axes. normalize ~ unbound_type_vars ~jkind_of_type
2243
+ Layout_and_axes. normalize ? unbound_type_vars ~jkind_of_type
2245
2244
~skip_axes: Axis_set. empty ~mode t.jkind
2246
2245
in
2247
2246
{ t with
Original file line number Diff line number Diff line change @@ -2656,14 +2656,20 @@ let check_redefined_unit (td: Parsetree.type_declaration) =
2656
2656
2657
2657
(* Normalize the jkinds in a list of (potentially mutually recursive) type declarations *)
2658
2658
let normalize_decl_jkinds env shapes decls =
2659
+ let unbound_type_vars =
2660
+ List. fold_left
2661
+ (fun acc (_ , _ , _ , decl ) ->
2662
+ Btype.TypeSet. union acc (Datarepr. unbound_type_vars decl))
2663
+ Btype.TypeSet. empty
2664
+ decls
2665
+ in
2659
2666
let rec normalize_decl_jkind env original_decl allow_any_crossing decl path =
2660
2667
let type_unboxed_version =
2661
2668
Option. map (fun type_unboxed_version ->
2662
2669
normalize_decl_jkind env (Option. get original_decl.type_unboxed_version)
2663
2670
allow_any_crossing type_unboxed_version (Path. unboxed_version path))
2664
2671
decl.type_unboxed_version
2665
2672
in
2666
- let unbound_type_vars = Datarepr. unbound_type_vars decl in
2667
2673
let normalized_jkind =
2668
2674
Jkind. normalize
2669
2675
~unbound_type_vars
You can’t perform that action at this time.
0 commit comments