@@ -1124,23 +1124,31 @@ let transl_declaration env sdecl (id, uid) =
11241124 also have unboxed versions, but these aren't stored in
11251125 [type_unboxed_version].
11261126*)
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
11271137let gets_unboxed_version decl =
11281138 (* This must be kept in sync with the match in [derive_unboxed_version] *)
11291139 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
11361143let derive_unboxed_version env path_in_group_has_unboxed_version decl =
11371144 (* This must be kept in sync with the match in [gets_unboxed_version] *)
11381145 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) ->
11421150 None
1143- | Type_record (lbls , ( Record_boxed _ | Record_mixed _ ) , umc ) ->
1151+ | Type_record (lbls , _ , umc ) ->
11441152 let keep_attribute a =
11451153 (* If we keep [@deprecated_mutable], then a record that aliases
11461154 a record with a [@deprecated_mutable] label will cause two alerts,
0 commit comments