Skip to content

Commit a1f78dd

Browse files
panagosg7facebook-github-bot
authored andcommitted
[flow] Singleton types get a with "generalizable" field
Summary: In the following code under natural inference ``` const x1 = "a"; const o1 = {f: x1}; ``` we would like to infer ``` x1: "a" // SingletonStrT("a") o1: {f:string} // ObjT {f: StrGeneralT} ``` At the same time, an annotated version of this code: ``` const x2: "a" = "a"; const o2 = {f: x2}; ``` should yield ``` x2: "a" // SingletonStrT("a") o2: {f:"a"} // ObjT {f: SingletonStrT("a")} ``` Note the difference between `o1` and `o2`. To enable this behavior we need to be able to distinguish between the two types of `SingletonStrT` that we infer for `x1` and `x2`. The key difference is whether we should allow a `SingletonStrT` to "generalize" to `StrGeneralT`. Roughly, a string literal type is generalizable iff it does not originate from an annotation, or a value under `as const`, or `Object.freeze()`. This diff adds a field `from_annot` to `SingletonStrT`, `SingletonNumT`, etc, and populates it accordingly. This field has no impact yet in typechecking behavior. It will only be used later to inform the generalization process. Changelog: [internal] Reviewed By: SamChou19815 Differential Revision: D66659579 fbshipit-source-id: 148f2e35de53debc600d17f735dc51cbd771d190
1 parent ae4c8c1 commit a1f78dd

20 files changed

+235
-167
lines changed

src/typing/annotation_inference.ml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -771,11 +771,11 @@ module rec ConsGen : S = struct
771771
BoolModuleT.at (loc_of_reason reason)
772772
(* !x when x is falsy *)
773773
| (DefT (_, BoolT_UNSOUND false), Annot_NotT reason)
774-
| (DefT (_, SingletonBoolT false), Annot_NotT reason)
774+
| (DefT (_, SingletonBoolT { value = false; _ }), Annot_NotT reason)
775775
| (DefT (_, StrT_UNSOUND (_, OrdinaryName "")), Annot_NotT reason)
776-
| (DefT (_, SingletonStrT (OrdinaryName "")), Annot_NotT reason)
776+
| (DefT (_, SingletonStrT { value = OrdinaryName ""; _ }), Annot_NotT reason)
777777
| (DefT (_, NumT_UNSOUND (_, (0., _))), Annot_NotT reason)
778-
| (DefT (_, SingletonNumT (0., _)), Annot_NotT reason)
778+
| (DefT (_, SingletonNumT { value = (0., _); _ }), Annot_NotT reason)
779779
| (DefT (_, NullT), Annot_NotT reason)
780780
| (DefT (_, VoidT), Annot_NotT reason) ->
781781
let reason = replace_desc_reason (RBooleanLit true) reason in
@@ -1152,11 +1152,12 @@ module rec ConsGen : S = struct
11521152
(*****************************)
11531153
| (DefT (reason, NumericStrKeyT (_, s)), _) ->
11541154
elab_t cx (DefT (reason, StrT_UNSOUND (None, OrdinaryName s))) op
1155-
| (DefT (reason, SingletonStrT key), _) ->
1155+
| (DefT (reason, SingletonStrT { value = key; _ }), _) ->
11561156
elab_t cx (DefT (reason, StrT_UNSOUND (None, key))) op
1157-
| (DefT (reason, SingletonNumT lit), _) ->
1157+
| (DefT (reason, SingletonNumT { value = lit; _ }), _) ->
11581158
elab_t cx (DefT (reason, NumT_UNSOUND (None, lit))) op
1159-
| (DefT (reason, SingletonBoolT b), _) -> elab_t cx (DefT (reason, BoolT_UNSOUND b)) op
1159+
| (DefT (reason, SingletonBoolT { value = b; _ }), _) ->
1160+
elab_t cx (DefT (reason, BoolT_UNSOUND b)) op
11601161
| (NullProtoT reason, _) -> elab_t cx (DefT (reason, NullT)) op
11611162
(********************)
11621163
(* Function Statics *)

src/typing/debug_js.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,12 @@ let rec dump_t_ (depth, tvars) cx t =
345345
)
346346
t
347347
| DefT (_, NumericStrKeyT (_, s)) -> p ~extra:s t
348-
| DefT (_, SingletonStrT s) -> p ~extra:(spf "%S" (display_string_of_name s)) t
349-
| DefT (_, SingletonNumT (_, s)) -> p ~extra:s t
350-
| DefT (_, SingletonBoolT b) -> p ~extra:(spf "%B" b) t
351-
| DefT (_, SingletonBigIntT (_, s)) -> p ~extra:s t
348+
| DefT (_, SingletonStrT { from_annot; value = s }) ->
349+
p ~extra:(spf "%S (from_annot=%b)" (display_string_of_name s) from_annot) t
350+
| DefT (_, SingletonNumT { from_annot; value = (_, s) }) ->
351+
p ~extra:(s ^ spf " (from_annot=%b)" from_annot) t
352+
| DefT (_, SingletonBoolT { value = b; _ }) -> p ~extra:(spf "%B" b) t
353+
| DefT (_, SingletonBigIntT { value = (_, s); _ }) -> p ~extra:s t
352354
| NamespaceT { namespace_symbol; values_type; types_tmap } ->
353355
p
354356
t

src/typing/env_resolution.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ let resolve_hint cx loc hint =
206206
UnionT (mk_reason (RCustom "providers") loc, UnionRep.make t1 t2 ts)
207207
| WriteLocHint (kind, loc) -> Type_env.checked_find_loc_env_write cx kind loc
208208
| StringLiteralType name ->
209-
DefT (mk_reason (RIdentifier (OrdinaryName name)) loc, SingletonStrT (OrdinaryName name))
209+
DefT
210+
( mk_reason (RIdentifier (OrdinaryName name)) loc,
211+
SingletonStrT { from_annot = true; value = OrdinaryName name }
212+
)
210213
| ReactFragmentType ->
211214
Flow_js_utils.ImportExportUtils.get_implicitly_imported_react_type
212215
cx

src/typing/flow_js.ml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,16 +1433,16 @@ struct
14331433
) ->
14341434
(match (drop_generic key, flags.obj_kind) with
14351435
(* If we have a literal string and that property exists *)
1436-
| (DefT (_, (StrT_UNSOUND (_, x) | SingletonStrT x)), _) when Context.has_prop cx mapr x
1437-
->
1436+
| (DefT (_, (StrT_UNSOUND (_, x) | SingletonStrT { value = x; _ })), _)
1437+
when Context.has_prop cx mapr x ->
14381438
()
14391439
(* If we have a dictionary, try that next *)
14401440
| (_, Indexed { key = expected_key; _ }) ->
14411441
rec_flow_t ~use_op cx trace (mod_reason_of_t (Fun.const reason_op) key, expected_key)
14421442
| _ ->
14431443
let (prop, suggestion) =
14441444
match drop_generic key with
1445-
| DefT (_, (StrT_UNSOUND (_, prop) | SingletonStrT prop)) ->
1445+
| DefT (_, (StrT_UNSOUND (_, prop) | SingletonStrT { value = prop; _ })) ->
14461446
(Some prop, prop_typo_suggestion cx [mapr] (display_string_of_name prop))
14471447
| _ -> (None, None)
14481448
in
@@ -1461,9 +1461,12 @@ struct
14611461
HasOwnPropT
14621462
( use_op,
14631463
reason_op,
1464-
( ( DefT (_, (StrT_UNSOUND (_, x) | SingletonStrT x))
1465-
| GenericT { bound = DefT (_, (StrT_UNSOUND (_, x) | SingletonStrT x)); _ } ) as
1466-
key
1464+
( ( DefT (_, (StrT_UNSOUND (_, x) | SingletonStrT { value = x; _ }))
1465+
| GenericT
1466+
{
1467+
bound = DefT (_, (StrT_UNSOUND (_, x) | SingletonStrT { value = x; _ }));
1468+
_;
1469+
} ) as key
14671470
)
14681471
)
14691472
) ->
@@ -3965,7 +3968,9 @@ struct
39653968
let r = reason_of_t value_t in
39663969
match index with
39673970
| None -> NumModuleT.why r
3968-
| Some i -> DefT (r, SingletonNumT (float_of_int i, string_of_int i))
3971+
| Some i ->
3972+
DefT
3973+
(r, SingletonNumT { from_annot = true; value = (float_of_int i, string_of_int i) })
39693974
in
39703975
Slice_utils.mk_mapped_prop_type
39713976
~use_op
@@ -5268,7 +5273,7 @@ struct
52685273
suggestion = None;
52695274
}
52705275
)
5271-
| ( DefT (reason, (NumT_UNSOUND (_, (value, _)) | SingletonNumT (value, _))),
5276+
| ( DefT (reason, (NumT_UNSOUND (_, (value, _)) | SingletonNumT { value = (value, _); _ })),
52725277
WriteComputedObjPropCheckT { reason_key; _ }
52735278
) ->
52745279
let kind = Flow_intermediate_error_types.InvalidObjKey.kind_of_num_value value in

src/typing/flow_js_utils.ml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ let ground_subtype = function
306306
)
307307
when String.starts_with ~prefix:prefix2 prefix1 ->
308308
true
309-
| ( DefT (_, (StrT_UNSOUND (None, OrdinaryName s) | SingletonStrT (OrdinaryName s))),
309+
| ( DefT (_, (StrT_UNSOUND (None, OrdinaryName s) | SingletonStrT { value = OrdinaryName s; _ })),
310310
UseT (_, StrUtilT { reason = _; op = StrPrefix prefix; remainder = None })
311311
)
312312
when String.starts_with ~prefix s ->
@@ -316,7 +316,7 @@ let ground_subtype = function
316316
)
317317
when String.ends_with ~suffix:suffix2 suffix1 ->
318318
true
319-
| ( DefT (_, (StrT_UNSOUND (None, OrdinaryName s) | SingletonStrT (OrdinaryName s))),
319+
| ( DefT (_, (StrT_UNSOUND (None, OrdinaryName s) | SingletonStrT { value = OrdinaryName s; _ })),
320320
UseT (_, StrUtilT { reason = _; op = StrSuffix suffix; remainder = None })
321321
)
322322
when String.ends_with ~suffix s ->
@@ -1015,7 +1015,7 @@ let obj_key_mirror cx o reason_op =
10151015
in
10161016
let map_field key t =
10171017
let reason = replace_desc_reason (RStringLit key) reason_op in
1018-
map_t (DefT (reason, SingletonStrT key)) t
1018+
map_t (DefT (reason, SingletonStrT { from_annot = true; value = key })) t
10191019
in
10201020
let props_tmap =
10211021
Context.find_props cx o.props_tmap
@@ -2699,8 +2699,12 @@ module GetPropT_kit (F : Get_prop_helper_sig) = struct
26992699
add_output cx Error_message.(EInternal (loc, PropRefComputedLiteral));
27002700
F.error_type cx trace reason_op
27012701
| GenericT
2702-
{ bound = DefT (_, (NumT_UNSOUND (_, (value, _)) | SingletonNumT (value, _))); _ }
2703-
| DefT (_, (NumT_UNSOUND (_, (value, _)) | SingletonNumT (value, _))) ->
2702+
{
2703+
bound =
2704+
DefT (_, (NumT_UNSOUND (_, (value, _)) | SingletonNumT { value = (value, _); _ }));
2705+
_;
2706+
}
2707+
| DefT (_, (NumT_UNSOUND (_, (value, _)) | SingletonNumT { value = (value, _); _ })) ->
27042708
let reason_prop = reason_of_t elem_t in
27052709
let kind = Flow_intermediate_error_types.InvalidObjKey.kind_of_num_value value in
27062710
add_output cx (Error_message.EObjectComputedPropertyAccess (reason_op, reason_prop, kind));
@@ -2749,8 +2753,10 @@ let array_elem_check
27492753
in
27502754
let (can_write_tuple, value, use_op) =
27512755
match l with
2752-
| DefT (index_reason, (NumT_UNSOUND (_, (float_value, _)) | SingletonNumT (float_value, _))) ->
2753-
begin
2756+
| DefT
2757+
( index_reason,
2758+
(NumT_UNSOUND (_, (float_value, _)) | SingletonNumT { value = (float_value, _); _ })
2759+
) -> begin
27542760
match elements with
27552761
| None -> (false, elem_t, use_op)
27562762
| Some elements ->
@@ -2843,19 +2849,21 @@ let array_elem_check
28432849
(value, is_tuple, use_op, react_dro)
28442850

28452851
let propref_for_elem_t = function
2846-
| OpaqueT (reason, { super_t = Some (DefT (_, SingletonStrT name)); _ })
2847-
| GenericT { bound = DefT (_, (SingletonStrT name | StrT_UNSOUND (_, name))); reason; _ }
2848-
| DefT (reason, (SingletonStrT name | StrT_UNSOUND (_, name))) ->
2852+
| OpaqueT (reason, { super_t = Some (DefT (_, SingletonStrT { value = name; _ })); _ })
2853+
| GenericT
2854+
{ bound = DefT (_, (SingletonStrT { value = name; _ } | StrT_UNSOUND (_, name))); reason; _ }
2855+
| DefT (reason, (SingletonStrT { value = name; _ } | StrT_UNSOUND (_, name))) ->
28492856
let reason = replace_desc_reason (RProperty (Some name)) reason in
28502857
mk_named_prop ~reason ~from_indexed_access:true name
2851-
| OpaqueT (reason_num, { super_t = Some (DefT (_, SingletonNumT (value, raw))); _ })
2858+
| OpaqueT (reason_num, { super_t = Some (DefT (_, SingletonNumT { value = (value, raw); _ })); _ })
28522859
| GenericT
28532860
{
2854-
bound = DefT (_, (NumT_UNSOUND (_, (value, raw)) | SingletonNumT (value, raw)));
2861+
bound =
2862+
DefT (_, (NumT_UNSOUND (_, (value, raw)) | SingletonNumT { value = (value, raw); _ }));
28552863
reason = reason_num;
28562864
_;
28572865
}
2858-
| DefT (reason_num, (NumT_UNSOUND (_, (value, raw)) | SingletonNumT (value, raw)))
2866+
| DefT (reason_num, (NumT_UNSOUND (_, (value, raw)) | SingletonNumT { value = (value, raw); _ }))
28592867
when Js_number.is_float_safe_integer value ->
28602868
let reason = replace_desc_reason (RProperty (Some (OrdinaryName raw))) reason_num in
28612869
let name = OrdinaryName (Dtoa.ecma_string_of_float value) in
@@ -2868,7 +2876,7 @@ let keylist_of_props props reason_op =
28682876
match name with
28692877
| OrdinaryName _ ->
28702878
let reason = replace_desc_new_reason (RStringLit name) reason_op in
2871-
DefT (reason, SingletonStrT name) :: acc
2879+
DefT (reason, SingletonStrT { from_annot = true; value = name }) :: acc
28722880
| InternalName _ -> acc)
28732881
props
28742882
[]
@@ -2984,9 +2992,9 @@ let flow_unary_arith cx l reason kind =
29842992
| (Minus, DefT (lreason, NumT_UNSOUND (_, lit))) ->
29852993
let (reason, lit) = unary_negate_lit ~annot_loc:(loc_of_reason reason) lreason lit in
29862994
DefT (reason, NumT_UNSOUND (None, lit))
2987-
| (Minus, DefT (lreason, SingletonNumT lit)) ->
2995+
| (Minus, DefT (lreason, SingletonNumT { from_annot; value = lit })) ->
29882996
let (reason, lit) = unary_negate_lit ~annot_loc:(loc_of_reason reason) lreason lit in
2989-
DefT (reason, SingletonNumT lit)
2997+
DefT (reason, SingletonNumT { from_annot; value = lit })
29902998
| (Minus, DefT (_, NumGeneralT _)) -> l
29912999
| (Minus, DefT (_, BigIntT_UNSOUND (_, (value, raw)))) ->
29923000
let (value, raw) = Flow_ast_utils.negate_bigint_literal (value, raw) in
@@ -3330,7 +3338,7 @@ end = struct
33303338

33313339
let on_concretized_bad_non_element_normalization normalization_cx = function
33323340
| DefT (invalid_type_reason, BoolT_UNSOUND false)
3333-
| DefT (invalid_type_reason, SingletonBoolT false)
3341+
| DefT (invalid_type_reason, SingletonBoolT { value = false; _ })
33343342
| DefT (invalid_type_reason, NullT)
33353343
| DefT (invalid_type_reason, VoidT) ->
33363344
TypeCollector.add normalization_cx.type_collector (AnyT.error normalization_cx.result_reason);
@@ -3373,7 +3381,7 @@ end = struct
33733381
invalid_type_reasons = Nel.one generic_reason;
33743382
}
33753383
)
3376-
| DefT (reason, SingletonStrT (OrdinaryName "svg")) ->
3384+
| DefT (reason, SingletonStrT { value = OrdinaryName "svg"; _ }) ->
33773385
TypeCollector.add
33783386
normalization_cx.type_collector
33793387
(DefT (reason, RendersT (InstrinsicRenders "svg")))

src/typing/object_kit.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ module Kit (Flow : Flow_common.S) : OBJECT = struct
6868
(fun (keys, indexers) t ->
6969
match t with
7070
| DefT (r, StrT_UNSOUND (_, name))
71-
| DefT (r, SingletonStrT name) ->
71+
| DefT (r, SingletonStrT { value = name; _ }) ->
7272
((name, r) :: keys, indexers)
7373
| DefT (_, EmptyT) -> (keys, indexers)
7474
| _ -> (keys, t :: indexers))

src/typing/predicate_kit.ml

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -545,16 +545,16 @@ and intersect =
545545
* handling a few cases here explicitly. *)
546546
let ground_types_differ t1 t2 =
547547
match (C.unwrap t1, C.unwrap t2) with
548-
| ( DefT (_, (SingletonStrT v1 | StrT_UNSOUND (_, v1))),
549-
DefT (_, (SingletonStrT v2 | StrT_UNSOUND (_, v2)))
548+
| ( DefT (_, (SingletonStrT { value = v1; _ } | StrT_UNSOUND (_, v1))),
549+
DefT (_, (SingletonStrT { value = v2; _ } | StrT_UNSOUND (_, v2)))
550550
) ->
551551
v1 <> v2
552-
| ( DefT (_, (SingletonNumT v1 | NumT_UNSOUND (_, v1))),
553-
DefT (_, (SingletonNumT v2 | NumT_UNSOUND (_, v2)))
552+
| ( DefT (_, (SingletonNumT { value = v1; _ } | NumT_UNSOUND (_, v1))),
553+
DefT (_, (SingletonNumT { value = v2; _ } | NumT_UNSOUND (_, v2)))
554554
) ->
555555
v1 <> v2
556-
| ( DefT (_, (SingletonBoolT v1 | BoolT_UNSOUND v1)),
557-
DefT (_, (SingletonBoolT v2 | BoolT_UNSOUND v2))
556+
| ( DefT (_, (SingletonBoolT { value = v1; _ } | BoolT_UNSOUND v1)),
557+
DefT (_, (SingletonBoolT { value = v2; _ } | BoolT_UNSOUND v2))
558558
) ->
559559
v1 <> v2
560560
| (_, _) -> false
@@ -1146,16 +1146,16 @@ and sentinel_prop_test_generic key cx trace result_collector orig_obj =
11461146
in
11471147
let sentinel_of_literal = function
11481148
| DefT (_, StrT_UNSOUND (_, value))
1149-
| DefT (_, SingletonStrT value) ->
1149+
| DefT (_, SingletonStrT { value; _ }) ->
11501150
Some UnionEnum.(One (Str value))
11511151
| DefT (_, NumT_UNSOUND (_, value))
1152-
| DefT (_, SingletonNumT value) ->
1152+
| DefT (_, SingletonNumT { value; _ }) ->
11531153
Some UnionEnum.(One (Num value))
11541154
| DefT (_, BoolT_UNSOUND value)
1155-
| DefT (_, SingletonBoolT value) ->
1155+
| DefT (_, SingletonBoolT { value; _ }) ->
11561156
Some UnionEnum.(One (Bool value))
11571157
| DefT (_, BigIntT_UNSOUND (_, value))
1158-
| DefT (_, SingletonBigIntT value) ->
1158+
| DefT (_, SingletonBigIntT { value; _ }) ->
11591159
Some UnionEnum.(One (BigInt value))
11601160
| DefT (_, VoidT) -> Some UnionEnum.(One Void)
11611161
| DefT (_, NullT) -> Some UnionEnum.(One Null)
@@ -1223,10 +1223,10 @@ and concretize_and_run_sentinel_prop_test
12231223
| UnionEnum.One enum ->
12241224
let def =
12251225
match enum with
1226-
| UnionEnum.Str v -> SingletonStrT v
1227-
| UnionEnum.Num v -> SingletonNumT v
1228-
| UnionEnum.Bool v -> SingletonBoolT v
1229-
| UnionEnum.BigInt v -> SingletonBigIntT v
1226+
| UnionEnum.Str v -> SingletonStrT { from_annot = true; value = v }
1227+
| UnionEnum.Num v -> SingletonNumT { from_annot = true; value = v }
1228+
| UnionEnum.Bool v -> SingletonBoolT { from_annot = true; value = v }
1229+
| UnionEnum.BigInt v -> SingletonBigIntT { from_annot = true; value = v }
12301230
| UnionEnum.Void -> VoidT
12311231
| UnionEnum.Null -> NullT
12321232
in
@@ -1258,10 +1258,10 @@ and concretize_and_run_sentinel_prop_test
12581258
(fun enum acc ->
12591259
let def =
12601260
match enum with
1261-
| UnionEnum.Str v -> SingletonStrT v
1262-
| UnionEnum.Num v -> SingletonNumT v
1263-
| UnionEnum.Bool v -> SingletonBoolT v
1264-
| UnionEnum.BigInt v -> SingletonBigIntT v
1261+
| UnionEnum.Str v -> SingletonStrT { from_annot = true; value = v }
1262+
| UnionEnum.Num v -> SingletonNumT { from_annot = true; value = v }
1263+
| UnionEnum.Bool v -> SingletonBoolT { from_annot = true; value = v }
1264+
| UnionEnum.BigInt v -> SingletonBigIntT { from_annot = true; value = v }
12651265
| UnionEnum.Void -> VoidT
12661266
| UnionEnum.Null -> NullT
12671267
in
@@ -1311,7 +1311,7 @@ and eq_test cx _trace result_collector (sense, left, right) =
13111311
let expected_loc = loc_of_t right in
13121312
match right with
13131313
| DefT (_, StrT_UNSOUND (_, value))
1314-
| DefT (_, SingletonStrT value) ->
1314+
| DefT (_, SingletonStrT { value; _ }) ->
13151315
let filtered =
13161316
if sense then
13171317
Type_filter.string_literal cx expected_loc sense value left
@@ -1320,7 +1320,7 @@ and eq_test cx _trace result_collector (sense, left, right) =
13201320
in
13211321
report_filtering_result_to_predicate_result filtered result_collector
13221322
| DefT (_, NumT_UNSOUND (_, value))
1323-
| DefT (_, SingletonNumT value) ->
1323+
| DefT (_, SingletonNumT { value; _ }) ->
13241324
let filtered =
13251325
if sense then
13261326
Type_filter.number_literal cx expected_loc sense value left
@@ -1329,7 +1329,7 @@ and eq_test cx _trace result_collector (sense, left, right) =
13291329
in
13301330
report_filtering_result_to_predicate_result filtered result_collector
13311331
| DefT (_, BoolT_UNSOUND true)
1332-
| DefT (_, SingletonBoolT true) ->
1332+
| DefT (_, SingletonBoolT { value = true; _ }) ->
13331333
let filtered =
13341334
if sense then
13351335
Type_filter.true_ cx left
@@ -1338,7 +1338,7 @@ and eq_test cx _trace result_collector (sense, left, right) =
13381338
in
13391339
report_filtering_result_to_predicate_result filtered result_collector
13401340
| DefT (_, BoolT_UNSOUND false)
1341-
| DefT (_, SingletonBoolT false) ->
1341+
| DefT (_, SingletonBoolT { value = false; _ }) ->
13421342
let filtered =
13431343
if sense then
13441344
Type_filter.false_ cx left
@@ -1347,7 +1347,7 @@ and eq_test cx _trace result_collector (sense, left, right) =
13471347
in
13481348
report_filtering_result_to_predicate_result filtered result_collector
13491349
| DefT (_, BigIntT_UNSOUND (_, value))
1350-
| DefT (_, SingletonBigIntT value) ->
1350+
| DefT (_, SingletonBigIntT { value; _ }) ->
13511351
let filtered =
13521352
if sense then
13531353
Type_filter.bigint_literal cx expected_loc sense value left

0 commit comments

Comments
 (0)