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
@@ -2318,13 +2318,12 @@ let for_object =
2318
2318
(* *****************************)
2319
2319
(* elimination and defaulting *)
2320
2320
2321
- let [@ inline] normalize ?(unbound_type_vars = Btype.TypeSet. empty) ~mode
2322
- ~jkind_of_type t =
2321
+ let [@ inline] normalize ?unbound_type_vars ~mode ~jkind_of_type t =
2323
2322
let mode : _ Layout_and_axes.normalize_mode =
2324
2323
match mode with Require_best -> Require_best | Ignore_best -> Ignore_best
2325
2324
in
2326
2325
let jkind, fuel_result =
2327
- Layout_and_axes. normalize ~ unbound_type_vars ~jkind_of_type
2326
+ Layout_and_axes. normalize ? unbound_type_vars ~jkind_of_type
2328
2327
~skip_axes: Axis_set. empty ~mode t.jkind
2329
2328
in
2330
2329
{ t with
Original file line number Diff line number Diff line change @@ -2759,14 +2759,20 @@ let check_redefined_unit (td: Parsetree.type_declaration) =
2759
2759
2760
2760
(* Normalize the jkinds in a list of (potentially mutually recursive) type declarations *)
2761
2761
let normalize_decl_jkinds env shapes decls =
2762
+ let unbound_type_vars =
2763
+ List. fold_left
2764
+ (fun acc (_ , _ , _ , decl ) ->
2765
+ Btype.TypeSet. union acc (Datarepr. unbound_type_vars decl))
2766
+ Btype.TypeSet. empty
2767
+ decls
2768
+ in
2762
2769
let rec normalize_decl_jkind env original_decl allow_any_crossing decl path =
2763
2770
let type_unboxed_version =
2764
2771
Option. map (fun type_unboxed_version ->
2765
2772
normalize_decl_jkind env (Option. get original_decl.type_unboxed_version)
2766
2773
allow_any_crossing type_unboxed_version (Path. unboxed_version path))
2767
2774
decl.type_unboxed_version
2768
2775
in
2769
- let unbound_type_vars = Datarepr. unbound_type_vars decl in
2770
2776
let normalized_jkind =
2771
2777
Jkind. normalize
2772
2778
~unbound_type_vars
You can’t perform that action at this time.
0 commit comments