From cbd64384dccaddaa8461d7850c24419e2217d13e Mon Sep 17 00:00:00 2001 From: Sam Goldman Date: Mon, 22 Apr 2019 14:53:28 -0700 Subject: [PATCH] Remove deprecated $call property syntax Summary: This feature was deprecated in D8042447 (Flow v0.75.0), which seems like a more than reasonable deprecation period. It should be easy to change any uses of this to use callable property syntax or the [[call]] internal slot property syntax. Removing this feature makes it possible to clean up a lot of crufty code with weird corner cases. Reviewed By: panagosg7 Differential Revision: D14648545 fbshipit-source-id: 48d6aefda5e0952ae6611e7e49f451eef61e89a5 --- src/common/lints/lintSettings.ml | 1 - src/common/lints/lints.ml | 3 - src/common/lints/lints.mli | 1 - src/typing/class_sig.ml | 28 +----- src/typing/class_sig.mli | 2 - src/typing/debug_js.ml | 2 - src/typing/errors/error_message.ml | 9 -- src/typing/ty_normalizer.ml | 18 +--- src/typing/type_annotation.ml | 99 +++++-------------- tests/call_properties/call_properties.exp | 26 +---- tests/call_properties/deprecated.js | 11 --- tests/lint_config_default/.flowconfig | 2 +- tests/type-at-pos_types/callable-object.js | 6 +- tests/type-at-pos_types/type-at-pos_types.exp | 18 ++-- 14 files changed, 40 insertions(+), 186 deletions(-) delete mode 100644 tests/call_properties/deprecated.js diff --git a/src/common/lints/lintSettings.ml b/src/common/lints/lintSettings.ml index 4a3874ddc6d..5c305a76f94 100644 --- a/src/common/lints/lintSettings.ml +++ b/src/common/lints/lintSettings.ml @@ -21,7 +21,6 @@ type 'a t = { } let default_lint_severities = [ - Lints.DeprecatedCallSyntax, (Severity.Err, None); Lints.DeprecatedUtility, (Severity.Err, None); ] diff --git a/src/common/lints/lints.ml b/src/common/lints/lints.ml index a87d70a6357..62b15257340 100644 --- a/src/common/lints/lints.ml +++ b/src/common/lints/lints.ml @@ -28,7 +28,6 @@ type lint_kind = | InexactSpread | UnnecessaryOptionalChain | UnnecessaryInvariant - | DeprecatedCallSyntax | SignatureVerificationFailure let string_of_sketchy_null_kind = function @@ -54,7 +53,6 @@ let string_of_kind = function | InexactSpread -> "inexact-spread" | UnnecessaryOptionalChain -> "unnecessary-optional-chain" | UnnecessaryInvariant -> "unnecessary-invariant" - | DeprecatedCallSyntax -> "deprecated-call-syntax" | SignatureVerificationFailure -> "signature-verification-failure" let kinds_of_string = function @@ -83,7 +81,6 @@ let kinds_of_string = function | "inexact-spread" -> Some [InexactSpread] | "unnecessary-optional-chain" -> Some [UnnecessaryOptionalChain] | "unnecessary-invariant" -> Some [UnnecessaryInvariant] - | "deprecated-call-syntax" -> Some [DeprecatedCallSyntax] | "signature-verification-failure" -> Some [SignatureVerificationFailure] | _ -> None diff --git a/src/common/lints/lints.mli b/src/common/lints/lints.mli index 3fba8dcae8a..6235a3638dd 100644 --- a/src/common/lints/lints.mli +++ b/src/common/lints/lints.mli @@ -28,7 +28,6 @@ type lint_kind = | InexactSpread | UnnecessaryOptionalChain | UnnecessaryInvariant - | DeprecatedCallSyntax | SignatureVerificationFailure val string_of_kind: lint_kind -> string diff --git a/src/typing/class_sig.ml b/src/typing/class_sig.ml index 8ffb9ffb001..7ce6666e8dc 100644 --- a/src/typing/class_sig.ml +++ b/src/typing/class_sig.ml @@ -37,7 +37,6 @@ type signature = { getters: func_info SMap.t; setters: func_info SMap.t; calls: Type.t list; - call_deprecated: Type.t option; } type t = { @@ -79,7 +78,6 @@ let empty id reason tparams tparams_map super = getters = SMap.empty; setters = SMap.empty; calls = []; - call_deprecated = None; } in let constructor = [] in let static = @@ -183,19 +181,7 @@ let append_method ~static name loc fsig ?(set_asts=ignore) ?(set_type=ignore) x }) x let append_call ~static t = map_sig ~static (fun s -> - (* Note that $call properties always override the call property syntax. - As before, if both are present, the $call property is used and the call - property is ignored. *) - match s.call_deprecated with - | None -> { s with calls = t :: s.calls } - | Some _ -> s -) - -let add_call_deprecated ~static t = map_sig ~static (fun s -> - (* Note that $call properties always override the call property syntax. - As before, if both are present, the $call property is used and the call - property is ignored. *) - { s with call_deprecated = Some t; calls = [] } + {s with calls = t :: s.calls} ) let add_getter ~static name loc fsig ?(set_asts=ignore) ?(set_type=ignore) x = @@ -246,7 +232,6 @@ let subst_sig cx map s = getters = SMap.map (subst_func_sig) s.getters; setters = SMap.map (subst_func_sig) s.setters; calls = Core_list.map ~f:(Flow.subst cx map) s.calls; - call_deprecated = Option.map ~f:(Flow.subst cx map) s.call_deprecated; } let subst_typeapp cx map (loc, c, targs) = @@ -378,16 +363,7 @@ let elements cx ?constructor s = (* Treat getters and setters as methods *) let methods = SMap.union getters_and_setters methods in - (* Previously, call properties were stored in the props map under the key - $call. Unfortunately, this made it possible to specify call properties - using this syntax in interfaces, declared classes, and even normal classes. - - Note that $call properties always override the call property syntax - As before, if both are present, the $call property is used and the call - property is ignored. *) - let call = match s.call_deprecated with - | Some t -> Some t - | None -> + let call = match List.rev s.calls with | [] -> None | [t] -> Some t diff --git a/src/typing/class_sig.mli b/src/typing/class_sig.mli index 6fa148d70f0..fef1dd56e53 100644 --- a/src/typing/class_sig.mli +++ b/src/typing/class_sig.mli @@ -124,8 +124,6 @@ val append_method: val append_call: static:bool -> Type.t -> t -> t -val add_call_deprecated: static:bool -> Type.t -> t -> t - (** Add getter to signature. *) val add_getter: static:bool -> diff --git a/src/typing/debug_js.ml b/src/typing/debug_js.ml index 91a603fa84e..993f8bacec6 100644 --- a/src/typing/debug_js.ml +++ b/src/typing/debug_js.ml @@ -2826,8 +2826,6 @@ let dump_error_message = spf "EDeprecatedType (%s)" (string_of_aloc loc) | EUnsafeGettersSetters loc -> spf "EUnclearGettersSetters (%s)" (string_of_aloc loc) - | EDeprecatedCallSyntax loc -> - spf "EDeprecatedCallSyntax (%s)" (string_of_aloc loc) | EUnusedSuppression loc -> spf "EUnusedSuppression (%s)" (string_of_aloc loc) | ELintSetting (loc, kind) -> diff --git a/src/typing/errors/error_message.ml b/src/typing/errors/error_message.ml index 08bdad81d41..b433f46b11b 100644 --- a/src/typing/errors/error_message.ml +++ b/src/typing/errors/error_message.ml @@ -177,7 +177,6 @@ and 'loc t' = | EUnnecessaryOptionalChain of 'loc * 'loc virtual_reason | EUnnecessaryInvariant of 'loc * 'loc virtual_reason | EInexactSpread of 'loc virtual_reason * 'loc virtual_reason - | EDeprecatedCallSyntax of 'loc | EUnexpectedTemporaryBaseType of 'loc | EBigIntNotYetSupported of 'loc virtual_reason (* These are unused when calculating locations so we can leave this as Aloc *) @@ -480,7 +479,6 @@ let map_loc_of_error_message (f : 'a -> 'b) : 'a t' -> 'b t' = | EUnnecessaryOptionalChain (loc, r) -> EUnnecessaryOptionalChain (f loc, map_reason r) | EUnnecessaryInvariant (loc, r) -> EUnnecessaryInvariant (f loc, map_reason r) | EInexactSpread (r1, r2) -> EInexactSpread (map_reason r1, map_reason r2) - | EDeprecatedCallSyntax loc -> EDeprecatedCallSyntax (f loc) | EUnexpectedTemporaryBaseType loc -> EUnexpectedTemporaryBaseType (f loc) | EBigIntNotYetSupported r -> EBigIntNotYetSupported (map_reason r) | ESignatureVerification _ as e -> e @@ -612,7 +610,6 @@ let util_use_op_of_msg nope util = function | EUnnecessaryOptionalChain _ | EUnnecessaryInvariant _ | EInexactSpread _ -| EDeprecatedCallSyntax _ | EUnexpectedTemporaryBaseType _ | EBigIntNotYetSupported _ | ESignatureVerification _ @@ -666,7 +663,6 @@ let aloc_of_msg : t -> ALoc.t option = function | EDeprecatedType loc | EDeprecatedUtility (loc, _) | EUnsafeGettersSetters loc - | EDeprecatedCallSyntax loc | EUnnecessaryOptionalChain (loc, _) | EUnnecessaryInvariant (loc, _) | EOptionalChainingMethods loc @@ -771,7 +767,6 @@ let kind_of_msg = Errors.(function | EDeprecatedUtility _ -> LintError Lints.DeprecatedUtility | EDynamicExport _ -> LintError Lints.DynamicExport | EUnsafeGettersSetters _ -> LintError Lints.UnsafeGettersSetters - | EDeprecatedCallSyntax _ -> LintError Lints.DeprecatedCallSyntax | ESketchyNullLint { kind; _ } -> LintError (Lints.SketchyNull kind) | ESketchyNumberLint (kind, _) -> LintError (Lints.SketchyNumber kind) | EUnnecessaryOptionalChain _ -> LintError Lints.UnnecessaryOptionalChain @@ -1746,10 +1741,6 @@ let friendly_message_of_msg : Loc.t t' -> Loc.t friendly_message_recipe = Normal [text "Getters and setters can have side effects and are unsafe."] - | EDeprecatedCallSyntax _ -> - Normal - [text "Deprecated $call syntax. Use callable property syntax instead."] - | EUnusedSuppression _ -> Normal [text "Unused suppression comment."] diff --git a/src/typing/ty_normalizer.ml b/src/typing/ty_normalizer.ml index 2d9d319c3eb..fa8e2d926bb 100644 --- a/src/typing/ty_normalizer.ml +++ b/src/typing/ty_normalizer.ml @@ -861,11 +861,6 @@ end = struct mapM (method_ty ~env) ts >>| fun ts -> Core_list.map ~f:(fun t -> Ty.CallProp t) ts - and call_prop ~env = function - | _, T.Method (_, t) - | _, T.Field (_, t, _) -> call_prop_from_t ~env t - | _ -> terr ~kind:BadCallProp None - and obj_props = (* call property *) let do_calls ~env = function @@ -876,10 +871,6 @@ end = struct | None -> return [] in - (* `$call` property *) - let do_calls_legacy ~env call_props = - concat_fold_m (call_prop ~env) call_props - in let do_props ~env props = concat_fold_m (obj_prop ~env) props in @@ -894,16 +885,11 @@ end = struct in fun ~env props_id call_id_opt dict -> let cx = Env.get_cx env in - let call_props, props = - Context.find_props cx props_id - |> SMap.bindings - |> Core_list.partition_tf ~f:(fun (x, _) -> x = "$call") - in - do_calls_legacy ~env call_props >>= fun call_props_legacy -> + let props = SMap.bindings (Context.find_props cx props_id) in do_calls ~env call_id_opt >>= fun call_props -> do_props ~env props >>= fun props -> do_dict ~env dict >>| fun dict -> - call_props_legacy @ call_props @ props @ dict + call_props @ props @ dict and arr_ty ~env reason elt_t = let arr_literal = match Reason.desc_of_reason reason with diff --git a/src/typing/type_annotation.ml b/src/typing/type_annotation.ml index 0789aeb8f3f..8f54abeebf7 100644 --- a/src/typing/type_annotation.ml +++ b/src/typing/type_annotation.ml @@ -937,13 +937,9 @@ let rec convert cx tparams_map = Ast.Type.(function | Object.CallProperty (_, { Object.CallProperty.static; _ }) -> not static | _ -> false ) properties in - let mk_object ~exact (call_props, dict, props_map, proto, call_deprecated) = + let mk_object ~exact (call_props, dict, props_map, proto) = let call = match List.rev call_props with - | [] -> - (* Note that call properties using the call property syntax always override - $call properties. Previously, if both were present, the $call property - was ignored, but is now left as a named property. *) - call_deprecated + | [] -> None | [t] -> Some t | t0::t1::ts -> let callable_reason = mk_reason (RCustom "callable object type") loc in @@ -951,21 +947,6 @@ let rec convert cx tparams_map = Ast.Type.(function let t = IntersectionT (callable_reason, rep) in Some t in - (* Previously, call properties were stored in the props map under the key - $call. Unfortunately, this made it possible to specify call properties - using this syntax in object types, and some libraries adopted this - syntax. - - Note that call properties using the call property syntax always override - $call properties. Previously, if both were present, the $call property - was ignored, but is now left as a named property. *) - let props_map, call = - if call <> None then props_map, call - else match SMap.get "$call" props_map with - | Some (Field (_, t, (Positive | Neutral))) -> - SMap.remove "$call" props_map, Some t - | _ -> props_map, call - in (* Use the same reason for proto and the ObjT so we can walk the proto chain and use the root proto reason to build an error. *) let props_map, proto = match proto with @@ -994,27 +975,12 @@ let rec convert cx tparams_map = Ast.Type.(function DefT (mk_reason reason_desc loc, annot_trust (), ObjT (mk_objecttype ~flags ~dict ~call pmap proto)) in - let property loc prop props proto call_deprecated = + let property loc prop props proto = match prop with | { Object.Property. key; value = Object.Property.Init value; optional; variance; _method; _ } -> begin match key with - (* Previously, call properties were stored in the props map under the key - $call. Unfortunately, this made it possible to specify call properties - using this syntax in object types, and some libraries adopted this - syntax. - - Note that call properties using the call property syntax always override - $call properties. Previously, if both were present, the $call property - was ignored, but is now left as a named property. *) - | Ast.Expression.Object.Property.Identifier (loc, { Ast.Identifier.name= "$call"; comments }) -> - Flow.add_output cx Error_message.(EDeprecatedCallSyntax loc); - let (_, t), _ as value_ast = convert cx tparams_map value in - let t = if optional then Type.optional t else t in - let key = Ast.Expression.Object.Property.Identifier ((loc, t), mk_commented_ident t comments "$call") in - props, proto, Some t, - { prop with Object.Property.key; value = Object.Property.Init value_ast } | Ast.Expression.Object.Property.Literal (loc, { Ast.Literal.value = Ast.Literal.String name; _ }) | Ast.Expression.Object.Property.Identifier (loc, { Ast.Identifier.name; comments= _ }) -> @@ -1038,21 +1004,21 @@ let rec convert cx tparams_map = Ast.Type.(function ) in let prop_ast = prop_ast proto in let proto = Some (Flow.mk_typeof_annotation cx reason proto) in - props, proto, call_deprecated, prop_ast + props, proto, prop_ast else let t = if optional then Type.optional t else t in let id_info = name, t, Type_table.Other in Type_table.set_info loc id_info (Context.type_table cx); let polarity = if _method then Positive else polarity variance in let props = SMap.add name (Field (Some loc, t, polarity)) props in - props, proto, call_deprecated, (prop_ast t) + props, proto, (prop_ast t) | Ast.Expression.Object.Property.Literal (loc, _) | Ast.Expression.Object.Property.PrivateName (loc, _) | Ast.Expression.Object.Property.Computed (loc, _) -> Flow.add_output cx (Error_message.EUnsupportedKeyInObjectType loc); let _, prop_ast = Tast_utils.error_mapper#object_property_type (loc, prop) in - props, proto, call_deprecated, prop_ast + props, proto, prop_ast end (* unsafe getter property *) @@ -1070,7 +1036,7 @@ let rec convert cx tparams_map = Ast.Type.(function let id_info = name, return_t, Type_table.Other in Type_table.set_info id_loc id_info (Context.type_table cx); let props = Properties.add_getter name (Some id_loc) return_t props in - props, proto, call_deprecated, + props, proto, { prop with Object.Property. key = Ast.Expression.Object.Property.Identifier ((id_loc, return_t), mk_commented_ident return_t comments name); value = Object.Property.Get (loc, f_ast); @@ -1090,7 +1056,7 @@ let rec convert cx tparams_map = Ast.Type.(function let id_info = name, param_t, Type_table.Other in Type_table.set_info id_loc id_info (Context.type_table cx); let props = Properties.add_setter name (Some id_loc) param_t props in - props, proto, call_deprecated, + props, proto, { prop with Object.Property. key = Ast.Expression.Object.Property.Identifier ((id_loc, param_t), mk_commented_ident param_t comments name); value = Object.Property.Set (loc, f_ast); @@ -1100,15 +1066,12 @@ let rec convert cx tparams_map = Ast.Type.(function Flow.add_output cx Error_message.(EUnsupportedSyntax (loc, ObjectPropertyGetSet)); let _, prop_ast = Tast_utils.error_mapper#object_property_type (loc, prop) in - props, proto, call_deprecated, prop_ast + props, proto, prop_ast in let add_call c = function - | None -> Some ([c], None, SMap.empty, None, None) - | Some (cs, d, pmap, proto, _) -> - (* Note that call properties using the call property syntax always override - $call properties. Previously, if both were present, the $call property - was ignored, but is now left as a named property. *) - Some (c::cs, d, pmap, proto, None) + | None -> Some ([c], None, SMap.empty, None) + | Some (cs, d, pmap, proto) -> + Some (c::cs, d, pmap, proto) in let make_dict ({ Object.Indexer.id; key; value; variance; _ } as indexer) = let (_, key), _ as key_ast = convert cx tparams_map key in @@ -1124,11 +1087,11 @@ let rec convert cx tparams_map = Ast.Type.(function let add_dict loc indexer = function | None -> let dict, indexer_ast = make_dict indexer in - Some ([], dict, SMap.empty, None, None), indexer_ast - | Some (cs, None, pmap, proto, call_deprecated) -> + Some ([], dict, SMap.empty, None), indexer_ast + | Some (cs, None, pmap, proto) -> let dict, indexer_ast = make_dict indexer in - Some (cs, dict, pmap, proto, call_deprecated), indexer_ast - | Some (_, Some _, _, _, _) as o -> + Some (cs, dict, pmap, proto), indexer_ast + | Some (_, Some _, _, _) as o -> Flow.add_output cx Error_message.(EUnsupportedSyntax (loc, MultipleIndexers)); let _, i = Tast_utils.error_mapper#object_indexer_type (loc, indexer) in @@ -1136,11 +1099,11 @@ let rec convert cx tparams_map = Ast.Type.(function in let add_prop loc p = function | None -> - let pmap, proto, call_deprecated, p_ast = property loc p SMap.empty None None in - Some ([], None, pmap, proto, call_deprecated), p_ast - | Some (cs, d, pmap, proto, call_deprecated) -> - let pmap, proto, call_deprecated, p_ast = property loc p pmap proto call_deprecated in - Some (cs, d, pmap, proto, call_deprecated), p_ast + let pmap, proto, p_ast = property loc p SMap.empty None in + Some ([], None, pmap, proto), p_ast + | Some (cs, d, pmap, proto) -> + let pmap, proto, p_ast = property loc p pmap proto in + Some (cs, d, pmap, proto), p_ast in let o, ts, spread, rev_prop_asts = List.fold_left Object.( fun (o, ts, spread, rev_prop_asts) -> function @@ -1194,7 +1157,7 @@ let rec convert cx tparams_map = Ast.Type.(function loc, match ts with | [] -> - let t = mk_object ~exact ([], None, SMap.empty, None, None) in + let t = mk_object ~exact ([], None, SMap.empty, None) in if exact then ExactT (mk_reason (RExactType reason_desc) loc, t) else t @@ -1532,24 +1495,6 @@ and add_interface_properties cx tparams_map properties s = Flow.add_output cx (Error_message.EUnsupportedSyntax (loc, Error_message.IllegalName)); x, Tast_utils.error_mapper#object_property_type (loc, prop) - (* Previously, call properties were stored in the props map under the key - $call. Unfortunately, this made it possible to specify call properties - using this syntax in interfaces, declared classes, and even normal classes. - - Note that $call properties always override the call property syntax. - As before, if both are present, the $call property is used and the call - property is ignored. *) - | _, (Property.Identifier (id_loc, { Ast.Identifier.name= "$call"; comments })), - Ast.Type.Object.Property.Init value when not proto -> - Flow.add_output cx Error_message.(EDeprecatedCallSyntax id_loc); - let (_, t), _ as value_ast = convert cx tparams_map value in - let t = if optional then Type.optional t else t in - add_call_deprecated ~static t x, - Ast.Type.(loc, { prop with Object.Property. - key = Property.Identifier ((id_loc, t), mk_commented_ident t comments "$call"); - value = Object.Property.Init value_ast; - }) - | true, (Property.Identifier (id_loc, { Ast.Identifier.name; comments })), Ast.Type.Object.Property.Init (func_loc, Ast.Type.Function func) -> let fsig, func_ast = mk_func_sig cx tparams_map loc func in diff --git a/tests/call_properties/call_properties.exp b/tests/call_properties/call_properties.exp index e7a73a86005..4ffd103ebf5 100644 --- a/tests/call_properties/call_properties.exp +++ b/tests/call_properties/call_properties.exp @@ -289,30 +289,6 @@ References: ^^^^^^^^^^^^^^^^ [1] -Error ------------------------------------------------------------------------------------------------ deprecated.js:2:3 - -Deprecated $call syntax. Use callable property syntax instead. (`deprecated-call-syntax`) - - 2| $call: () => void; - ^^^^^ - - -Error ------------------------------------------------------------------------------------------------ deprecated.js:6:3 - -Deprecated $call syntax. Use callable property syntax instead. (`deprecated-call-syntax`) - - 6| $call: () => void; - ^^^^^ - - -Error ----------------------------------------------------------------------------------------------- deprecated.js:10:3 - -Deprecated $call syntax. Use callable property syntax instead. (`deprecated-call-syntax`) - - 10| $call: () => void; - ^^^^^ - - Error --------------------------------------------------------------------------------------------- internal_slot.js:5:2 Cannot cast object literal to `O` because a call signature declaring the expected parameter / return type is missing in @@ -458,7 +434,7 @@ References: -Found 30 errors +Found 27 errors Only showing the most relevant union/intersection branches. To see all branches, re-run Flow with --show-all-branches diff --git a/tests/call_properties/deprecated.js b/tests/call_properties/deprecated.js deleted file mode 100644 index 64439d3024a..00000000000 --- a/tests/call_properties/deprecated.js +++ /dev/null @@ -1,11 +0,0 @@ -type O = { - $call: () => void; -} - -interface I { - $call: () => void; -} - -declare class C { - $call: () => void; -} diff --git a/tests/lint_config_default/.flowconfig b/tests/lint_config_default/.flowconfig index c269cc5c3a2..d7b6fb84827 100644 --- a/tests/lint_config_default/.flowconfig +++ b/tests/lint_config_default/.flowconfig @@ -1,2 +1,2 @@ [lints] -deprecated-call-syntax=error +deprecated-utility=error diff --git a/tests/type-at-pos_types/callable-object.js b/tests/type-at-pos_types/callable-object.js index ca43d97dcb0..10f48203867 100644 --- a/tests/type-at-pos_types/callable-object.js +++ b/tests/type-at-pos_types/callable-object.js @@ -11,7 +11,7 @@ type Obj1 = { }; type Obj2 = { - $call: (...args: $ReadOnlyArray) => void, + $call: (...args: $ReadOnlyArray) => void, // named prop f: (x: T) => T }; @@ -23,14 +23,14 @@ type Obj3 = { type Obj4 = { (...args: $ReadOnlyArray): O1, (...args: $ReadOnlyArray): O2, - $call: (...args: $ReadOnlyArray) => O3, // overridden + $call: (...args: $ReadOnlyArray) => O3, // named prop [[call]]: (...args: $ReadOnlyArray) => O4, f: (x: T) => T }; type Obj5 = { [[call]]: (...args: $ReadOnlyArray) => O4, - $call: (...args: $ReadOnlyArray) => O3, // overridden + $call: (...args: $ReadOnlyArray) => O3, // named prop (...args: $ReadOnlyArray): O1, (...args: $ReadOnlyArray): O2, f: (x: T) => T, diff --git a/tests/type-at-pos_types/type-at-pos_types.exp b/tests/type-at-pos_types/type-at-pos_types.exp index 9a69850e80f..cd4192e4bc2 100644 --- a/tests/type-at-pos_types/type-at-pos_types.exp +++ b/tests/type-at-pos_types/type-at-pos_types.exp @@ -542,7 +542,7 @@ callable-object.js:8:6 = { "end":9 } callable-object.js:13:6 = { - "type":"type Obj2 = {(...args: $ReadOnlyArray): void, f: (x: T) => T}", + "type":"type Obj2 = {$call: (...args: $ReadOnlyArray) => void, f: (x: T) => T}", "reasons":[], "loc":{ "source":"callable-object.js", @@ -562,8 +562,8 @@ callable-object.js:18:6 = { "loc":{ "source":"callable-object.js", "type":"SourceFile", - "start":{"line":18,"column":6,"offset":281}, - "end":{"line":18,"column":9,"offset":285} + "start":{"line":18,"column":6,"offset":295}, + "end":{"line":18,"column":9,"offset":299} }, "path":"callable-object.js", "line":18, @@ -572,13 +572,13 @@ callable-object.js:18:6 = { "end":9 } callable-object.js:23:6 = { - "type":"type Obj4 = {(...args: $ReadOnlyArray): O1, (...args: $ReadOnlyArray): O2, (...args: $ReadOnlyArray): O4, f: (x: T) => T}", + "type":"type Obj4 = {(...args: $ReadOnlyArray): O1, (...args: $ReadOnlyArray): O2, (...args: $ReadOnlyArray): O4, $call: (...args: $ReadOnlyArray) => O3, f: (x: T) => T}", "reasons":[], "loc":{ "source":"callable-object.js", "type":"SourceFile", - "start":{"line":23,"column":6,"offset":373}, - "end":{"line":23,"column":9,"offset":377} + "start":{"line":23,"column":6,"offset":387}, + "end":{"line":23,"column":9,"offset":391} }, "path":"callable-object.js", "line":23, @@ -587,13 +587,13 @@ callable-object.js:23:6 = { "end":9 } callable-object.js:31:6 = { - "type":"type Obj5 = {(...args: $ReadOnlyArray): O4, (...args: $ReadOnlyArray): O1, (...args: $ReadOnlyArray): O2, f: (x: T) => T}", + "type":"type Obj5 = {(...args: $ReadOnlyArray): O4, (...args: $ReadOnlyArray): O1, (...args: $ReadOnlyArray): O2, $call: (...args: $ReadOnlyArray) => O3, f: (x: T) => T}", "reasons":[], "loc":{ "source":"callable-object.js", "type":"SourceFile", - "start":{"line":31,"column":6,"offset":606}, - "end":{"line":31,"column":9,"offset":610} + "start":{"line":31,"column":6,"offset":620}, + "end":{"line":31,"column":9,"offset":624} }, "path":"callable-object.js", "line":31,