Skip to content

Commit a0df7fc

Browse files
committed
Use Block_shape.element_kind
1 parent ae38681 commit a0df7fc

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

middle_end/flambda2/types/grammar/more_type_creators.ml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,7 @@ let unknown (kind : K.t) =
3434
let unknown_like t = unknown (TG.kind t)
3535

3636
let unknown_from_shape (shape : K.Block_shape.t) index =
37-
let kind =
38-
match shape with
39-
| Value_only -> K.value
40-
| Float_record -> K.naked_float
41-
| Mixed_record fields -> (K.Mixed_block_shape.field_kinds fields).(index)
42-
in
43-
unknown kind
37+
unknown (K.Block_shape.element_kind shape index)
4438

4539
let bottom (kind : K.t) =
4640
match kind with
@@ -175,13 +169,7 @@ let immutable_block_with_size_at_least ~tag ~n ~shape ~field_n_minus_one =
175169
let n = Targetint_31_63.to_int n in
176170
let field_tys =
177171
List.init n (fun index ->
178-
let field_kind =
179-
match (shape : K.Block_shape.t) with
180-
| Value_only -> K.value
181-
| Float_record -> K.naked_float
182-
| Mixed_record kinds ->
183-
(K.Mixed_block_shape.field_kinds kinds).(index)
184-
in
172+
let field_kind = K.Block_shape.element_kind shape index in
185173
if index < n - 1
186174
then unknown field_kind
187175
else TG.alias_type_of field_kind (Simple.var field_n_minus_one))

0 commit comments

Comments
 (0)