@@ -1124,23 +1124,31 @@ let transl_declaration env sdecl (id, uid) =
1124
1124
also have unboxed versions, but these aren't stored in
1125
1125
[type_unboxed_version].
1126
1126
*)
1127
+ let record_gets_unboxed_version = function
1128
+ | Record_unboxed | Record_inlined _ | Record_float | Record_ufloat -> false
1129
+ | Record_boxed _ -> true
1130
+ | Record_mixed shape ->
1131
+ Array. for_all
1132
+ (fun (kind : mixed_block_element ) ->
1133
+ match kind with
1134
+ | Value | Float64 | Float32 | Bits32 | Bits64 | Vec128 | Word -> true
1135
+ | Float_boxed -> false )
1136
+ shape
1127
1137
let gets_unboxed_version decl =
1128
1138
(* This must be kept in sync with the match in [derive_unboxed_version] *)
1129
1139
match decl.type_kind with
1130
- | Type_abstract _ | Type_open | Type_record_unboxed_product _ | Type_variant _
1131
- | Type_record (_, (Record_unboxed | Record_inlined _ | Record_float
1132
- | Record_ufloat ), _ )->
1133
- false
1134
- | Type_record (_ , (Record_boxed _ | Record_mixed _ ), _ ) ->
1135
- true
1140
+ | Type_abstract _ | Type_open | Type_record_unboxed_product _
1141
+ | Type_variant _ -> false
1142
+ | Type_record (_ , repr , _ ) -> record_gets_unboxed_version repr
1136
1143
let derive_unboxed_version env path_in_group_has_unboxed_version decl =
1137
1144
(* This must be kept in sync with the match in [gets_unboxed_version] *)
1138
1145
match decl.type_kind with
1139
- | Type_abstract _ | Type_open | Type_record_unboxed_product _ | Type_variant _
1140
- | Type_record (_, (Record_unboxed | Record_inlined _ | Record_float
1141
- | Record_ufloat ), _ )->
1146
+ | Type_abstract _ | Type_open | Type_record_unboxed_product _
1147
+ | Type_variant _ ->
1148
+ None
1149
+ | Type_record (_ , repr , _ ) when not (record_gets_unboxed_version repr) ->
1142
1150
None
1143
- | Type_record (lbls , ( Record_boxed _ | Record_mixed _ ) , umc ) ->
1151
+ | Type_record (lbls , _ , umc ) ->
1144
1152
let keep_attribute a =
1145
1153
(* If we keep [@deprecated_mutable], then a record that aliases
1146
1154
a record with a [@deprecated_mutable] label will cause two alerts,
0 commit comments