Skip to content

Commit a9e4c16

Browse files
committed
fix literal_overlaps
1 parent 5346bb1 commit a9e4c16

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

jscomp/ml/ast_untagged_variants.ml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,12 @@ module DynamicChecks = struct
393393
in
394394
let literals_overlaps_with_number () =
395395
Ext_list.exists literal_cases (function
396-
| Int _ | Float _ | Bigint _ -> true
396+
| Int _ | Float _ -> true
397+
| _ -> false)
398+
in
399+
let literals_overlaps_with_bigint () =
400+
Ext_list.exists literal_cases (function
401+
| Bigint _ -> true
397402
| _ -> false)
398403
in
399404
let literals_overlaps_with_boolean () =
@@ -416,7 +421,7 @@ module DynamicChecks = struct
416421
typeof e != number
417422
| FloatType when literals_overlaps_with_number () = false ->
418423
typeof e != number
419-
| BigintType when literals_overlaps_with_number () = false ->
424+
| BigintType when literals_overlaps_with_bigint () = false ->
420425
typeof e != bigint
421426
| BooleanType when literals_overlaps_with_boolean () = false ->
422427
typeof e != boolean

0 commit comments

Comments
 (0)