@@ -131,7 +131,7 @@ type error =
131
131
| Nonrec_gadt
132
132
| Invalid_private_row_declaration of type_expr
133
133
| Local_not_enabled
134
- | Unexpected_jkind_any_in_primitive of string
134
+ | Unexpected_layout_any_in_primitive of string
135
135
| Useless_layout_poly
136
136
| Modalities_on_value_description
137
137
| Zero_alloc_attr_unsupported of Builtin_attributes .zero_alloc_attribute
@@ -2653,7 +2653,7 @@ let make_native_repr env core_type ty ~global_repr ~is_layout_poly ~why =
2653
2653
error_if_has_deep_native_repr_attributes core_type;
2654
2654
let sort_or_poly =
2655
2655
match get_desc (Ctype. get_unboxed_type_approximation env ty) with
2656
- (* This only captures tvars with jkind [any] explicitly quantified within
2656
+ (* This only captures tvars with layout [any] explicitly quantified within
2657
2657
the declaration.
2658
2658
2659
2659
This is sufficient since [transl_type_scheme] promises that:
@@ -2662,7 +2662,7 @@ let make_native_repr env core_type ty ~global_repr ~is_layout_poly ~why =
2662
2662
transl)
2663
2663
*)
2664
2664
| Tvar {jkind} when is_layout_poly
2665
- && Jkind. is_any jkind
2665
+ && Jkind. has_layout_any jkind
2666
2666
&& get_level ty = Btype. generic_level -> Poly
2667
2667
| _ ->
2668
2668
let sort =
@@ -2793,18 +2793,18 @@ let check_unboxable env loc ty =
2793
2793
all_unboxable_types
2794
2794
()
2795
2795
2796
- let has_ty_var_with_jkind_any env ty =
2796
+ let has_ty_var_with_layout_any env ty =
2797
2797
List. exists
2798
- (fun ty -> Jkind. is_any (Ctype. estimate_type_jkind env ty))
2798
+ (fun ty -> Jkind. has_layout_any (Ctype. estimate_type_jkind env ty))
2799
2799
(Ctype. free_variables ty)
2800
2800
2801
- let unexpected_jkind_any_check prim env cty ty =
2802
- if Primitive. prim_can_contain_jkind_any prim ||
2801
+ let unexpected_layout_any_check prim env cty ty =
2802
+ if Primitive. prim_can_contain_layout_any prim ||
2803
2803
prim.prim_is_layout_poly then ()
2804
2804
else
2805
- if has_ty_var_with_jkind_any env ty then
2805
+ if has_ty_var_with_layout_any env ty then
2806
2806
raise(Error (cty.ctyp_loc,
2807
- Unexpected_jkind_any_in_primitive (prim.prim_name)))
2807
+ Unexpected_layout_any_in_primitive (prim.prim_name)))
2808
2808
2809
2809
(* Note regarding jkind checks on external declarations
2810
2810
@@ -2852,13 +2852,14 @@ let unexpected_jkind_any_check prim env cty ty =
2852
2852
point to the source of the mistake which is, in fact, the external
2853
2853
declaration.
2854
2854
2855
- For this reason, we have [unexpected_jkind_any_check]. It's here to point
2856
- out this type of mistake early and suggest the use of [@layout_poly].
2855
+ For this reason, we have [unexpected_layout_any_check]. It's here to
2856
+ point out this type of mistake early and suggest the use of
2857
+ [@layout_poly].
2857
2858
2858
2859
An exception is raised if any of these checks fails. *)
2859
2860
let error_if_containing_unexpected_jkind prim env cty ty =
2860
2861
Primitive. prim_has_valid_reprs ~loc: cty.ctyp_loc prim;
2861
- unexpected_jkind_any_check prim env cty ty
2862
+ unexpected_layout_any_check prim env cty ty
2862
2863
2863
2864
(* Translate a value declaration *)
2864
2865
let transl_value_decl env loc valdecl =
@@ -2918,7 +2919,7 @@ let transl_value_decl env loc valdecl =
2918
2919
Builtin_attributes. has_layout_poly valdecl.pval_attributes
2919
2920
in
2920
2921
if is_layout_poly &&
2921
- not (has_ty_var_with_jkind_any env ty) then
2922
+ not (has_ty_var_with_layout_any env ty) then
2922
2923
raise(Error (valdecl.pval_type.ptyp_loc, Useless_layout_poly ));
2923
2924
let native_repr_args, native_repr_res =
2924
2925
parse_native_repr_attributes
@@ -3688,7 +3689,7 @@ let report_error ppf = function
3688
3689
| Local_not_enabled ->
3689
3690
fprintf ppf " @[The local extension is disabled@ \
3690
3691
To enable it, pass the '-extension local' flag@]"
3691
- | Unexpected_jkind_any_in_primitive name ->
3692
+ | Unexpected_layout_any_in_primitive name ->
3692
3693
fprintf ppf
3693
3694
" @[The primitive [%s] doesn't work well with type variables of@ \
3694
3695
layout any. Consider using [@@layout_poly].@]" name
0 commit comments