Skip to content

Commit 0a8f727

Browse files
committed
logic
1 parent 00a2597 commit 0a8f727

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jscomp/ml/variant_coercion.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ let can_coerce_polyvariant_to_variant ~row_fields ~constructors ~type_attributes
190190
However, there's a special case with unboxed types where there's a
191191
string catch-all case. In that case, any polyvariant will match,
192192
since the catch-all case will match any string. *)
193-
(match c.cd_args with
194-
| Cstr_tuple [{desc=Tconstr (p, _, _)}]
195-
when is_unboxed && Path.same p Predef.path_string -> true
193+
(match is_unboxed, c.cd_args with
194+
| true, Cstr_tuple [{desc=Tconstr (p, _, _)}] ->
195+
Path.same p Predef.path_string
196196
| _ -> polyvariant_value = constructor_name)
197197
))
198198
polyvariant_runtime_representations

0 commit comments

Comments
 (0)