Error ------------------------------------------------------------------------------- class_index_signature_usage.js:5:1 Cannot cast `obj["foo"]` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] class_index_signature_usage.js:5:1 5| obj["foo"] as string; // ERROR: number is not string ^^^^^^^^^^ References: class_index_signature.d.ts:2:18 2| [key: string]: number; ^^^^^^ [1] class_index_signature_usage.js:5:15 5| obj["foo"] as string; // ERROR: number is not string ^^^^^^ [2] Error -------------------------------------------------------------------------- class_optional_method_signatures.js:2:3 Declare methods in classes are not supported. [unsupported-syntax] 2| m?(x: number): string; // ERROR ^^^^^^^^^^^^^^^^^^^^^ Error -------------------------------------------------------------------------- class_optional_method_signatures.js:3:3 Declare methods in classes are not supported. [unsupported-syntax] 3| static s?(): number; // ERROR ^^^^^^^^^^^^^^^^^^^ Error -------------------------------------------------------------------------- class_optional_method_signatures.js:4:3 Declare methods in classes are not supported. [unsupported-syntax] 4| generic?(x: T): T; // ERROR ^^^^^^^^^^^^^^^^^^^^ Error -------------------------------------------------------------------------- class_optional_method_signatures.js:5:3 Declare methods in classes are not supported. [unsupported-syntax] 5| ["computed"]?(x: number): number; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error -------------------------------------------------------------------------- class_optional_method_signatures.js:9:3 Declare methods in classes are not supported. [unsupported-syntax] 9| m(): void; // ERROR ^^^^^^^^^ Error --------------------------------------------------------------------------------- computed_property_key.d.ts:86:29 Unsupported key in object type. Only identifier, string literal, and number literal keys are allowed. [illegal-key] 86| export type WithUnionKey = {[UNION_KEY]: number}; // ERROR ^^^^^^^^^^^ Error ------------------------------------------------------------------------ computed_property_key_remote_usage.js:6:1 Cannot cast `strObj.remoteProp` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_remote_usage.js:6:1 6| strObj.remoteProp as string; // ERROR ^^^^^^^^^^^^^^^^^ References: computed_property_key_remote.d.ts:5:51 5| export type WithRemoteStrKey = {[REMOTE_STR_KEY]: number}; ^^^^^^ [1] computed_property_key_remote_usage.js:6:22 6| strObj.remoteProp as string; // ERROR ^^^^^^ [2] Error ----------------------------------------------------------------------- computed_property_key_remote_usage.js:11:1 Cannot cast `numObj[99]` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] computed_property_key_remote_usage.js:11:1 11| numObj[99] as number; // ERROR ^^^^^^^^^^ References: computed_property_key_remote.d.ts:8:51 8| export type WithRemoteNumKey = {[REMOTE_NUM_KEY]: string}; ^^^^^^ [1] computed_property_key_remote_usage.js:11:15 11| numObj[99] as number; // ERROR ^^^^^^ [2] Error ----------------------------------------------------------------------- computed_property_key_remote_usage.js:16:1 Cannot cast `ifaceObj.remoteProp` to `string` because `boolean` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_remote_usage.js:16:1 16| ifaceObj.remoteProp as string; // ERROR ^^^^^^^^^^^^^^^^^^^ References: computed_property_key_remote.d.ts:12:21 12| [REMOTE_STR_KEY]: boolean; ^^^^^^^ [1] computed_property_key_remote_usage.js:16:24 16| ifaceObj.remoteProp as string; // ERROR ^^^^^^ [2] Error ----------------------------------------------------------------------- computed_property_key_remote_usage.js:21:1 Cannot cast `classObj[99]` to `string` because `boolean` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_remote_usage.js:21:1 21| classObj[99] as string; // ERROR ^^^^^^^^^^^^ References: computed_property_key_remote.d.ts:17:21 17| [REMOTE_NUM_KEY]: boolean; ^^^^^^^ [1] computed_property_key_remote_usage.js:21:17 21| classObj[99] as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------- computed_property_key_usage.js:9:1 Cannot cast `strObj.myProp` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_usage.js:9:1 9| strObj.myProp as string; // ERROR ^^^^^^^^^^^^^ References: computed_property_key.d.ts:3:38 3| export type WithStrKey = {[STR_KEY]: number}; ^^^^^^ [1] computed_property_key_usage.js:9:18 9| strObj.myProp as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:14:1 Cannot cast `numObj[42]` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] computed_property_key_usage.js:14:1 14| numObj[42] as number; // ERROR ^^^^^^^^^^ References: computed_property_key.d.ts:7:38 7| export type WithNumKey = {[NUM_KEY]: string}; ^^^^^^ [1] computed_property_key_usage.js:14:15 14| numObj[42] as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:23:1 Cannot cast `ifaceObj.ifaceProp` to `string` because `boolean` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_usage.js:23:1 23| ifaceObj.ifaceProp as string; // ERROR ^^^^^^^^^^^^^^^^^^ References: computed_property_key.d.ts:15:16 15| [IFACE_KEY]: boolean; ^^^^^^^ [1] computed_property_key_usage.js:23:23 23| ifaceObj.ifaceProp as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:32:1 Cannot cast `optMethodObj.myMethod` to `string` because `(x: number) => void` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_usage.js:32:1 32| optMethodObj.myMethod as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^ References: computed_property_key.d.ts:35:35 35| export type WithOptionalMethod = {[METHOD_KEY]?(x: number): void}; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] computed_property_key_usage.js:32:26 32| optMethodObj.myMethod as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:32:1 Cannot cast `optMethodObj.myMethod` to `string` because `void` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_usage.js:32:1 32| optMethodObj.myMethod as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^ References: computed_property_key.d.ts:35:35 35| export type WithOptionalMethod = {[METHOD_KEY]?(x: number): void}; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] computed_property_key_usage.js:32:26 32| optMethodObj.myMethod as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:42:1 Cannot cast `protoObj.protoMethod()` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] computed_property_key_usage.js:42:1 42| protoObj.protoMethod() as number; // ERROR ^^^^^^^^^^^^^^^^^^^^^^ References: computed_property_key.d.ts:44:18 44| [PROTO_KEY](): string; ^^^^^^ [1] computed_property_key_usage.js:42:27 42| protoObj.protoMethod() as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:53:1 Cannot cast `strLitObj.directStr` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_usage.js:53:1 53| strLitObj.directStr as string; // ERROR ^^^^^^^^^^^^^^^^^^^ References: computed_property_key.d.ts:55:45 55| export type WithStrLitKey = {["directStr"]: number}; ^^^^^^ [1] computed_property_key_usage.js:53:24 53| strLitObj.directStr as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:59:1 Cannot cast `numLitObj[100]` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] computed_property_key_usage.js:59:1 59| numLitObj[100] as number; // ERROR ^^^^^^^^^^^^^^ References: computed_property_key.d.ts:58:37 58| export type WithNumLitKey = {[100]: string}; ^^^^^^ [1] computed_property_key_usage.js:59:19 59| numLitObj[100] as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:65:1 Cannot cast `memberObj.nsProp` to `string` because `boolean` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_usage.js:65:1 65| memberObj.nsProp as string; // ERROR ^^^^^^^^^^^^^^^^ References: computed_property_key.d.ts:62:42 62| export type WithMemberKey = {[Keys.foo]: boolean}; ^^^^^^^ [1] computed_property_key_usage.js:65:21 65| memberObj.nsProp as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:71:1 Cannot cast `memberMethodObj.nsMethod()` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] computed_property_key_usage.js:71:1 71| memberMethodObj.nsMethod() as number; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^^^ References: computed_property_key.d.ts:67:23 67| [MethodKeys.bar](): string; ^^^^^^ [1] computed_property_key_usage.js:71:31 71| memberMethodObj.nsMethod() as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:77:1 Cannot cast `memberClassObj.nsClassProp` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] computed_property_key_usage.js:77:1 77| memberClassObj.nsClassProp as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^^^ References: computed_property_key.d.ts:73:20 73| [ClassKeys.baz]: number; ^^^^^^ [1] computed_property_key_usage.js:77:31 77| memberClassObj.nsClassProp as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:83:8 Cannot get `accObj.classProp` because property `classProp` is missing in `WithAccessibility` [1]. [prop-missing] computed_property_key_usage.js:83:8 83| accObj.classProp as number; // ERROR: private ^^^^^^^^^ References: computed_property_key_usage.js:81:23 81| declare const accObj: WithAccessibility; ^^^^^^^^^^^^^^^^^ [1] Error ----------------------------------------------------------------------------- computed_property_key_usage.js:89:10 Cannot get `unionObj.a` because property `a` is missing in `WithUnionKey` [1]. [prop-missing] computed_property_key_usage.js:89:10 89| unionObj.a; // ERROR ^ References: computed_property_key_usage.js:88:25 88| declare const unionObj: WithUnionKey; ^^^^^^^^^^^^ [1] Error ------------------------------------------------------------------------------ computed_property_key_usage.js:99:1 Cannot cast `methodSigs.classMethod()` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] computed_property_key_usage.js:99:1 99| methodSigs.classMethod() as number; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^ References: computed_property_key.d.ts:94:25 94| [CLASS_METHOD_KEY](): string; ^^^^^^ [1] computed_property_key_usage.js:99:29 99| methodSigs.classMethod() as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ declare_class_method_no_return.d.ts:33:12 Return type annotation is required for `declare class` methods. [unsupported-syntax] 33| get foo(); // ERROR — getter without return type still errors (asymmetry preserved) Error ---------------------------------------------------------------------- declare_class_method_no_return_usage.js:8:9 Cannot assign `'hello'` to `s.foo` because `"hello"` [1] is incompatible with `number` [2]. [incompatible-type] declare_class_method_no_return_usage.js:8:9 8| s.foo = 'hello'; // ERROR — string ~> number setter parameter ^^^^^^^ [1] References: declare_class_method_no_return.d.ts:8:14 8| set foo(v: number); ^^^^^^ [2] Error ---------------------------------------------------------------------------- declare_type_only_export_usage.js:3:1 Cannot cast `'oops'` to `X` because `"oops"` [1] is incompatible with `SomeOtherType` [2]. [incompatible-type] declare_type_only_export_usage.js:3:1 3| 'oops' as X; // ERROR - string is not number ^^^^^^ [1] References: declare_type_only_export_usage.js:3:11 3| 'oops' as X; // ERROR - string is not number ^ [2] Error ---------------------------------------------------------------------------- declare_type_only_export_usage.js:4:2 Cannot cast object literal to `I` because object literal [1] is incompatible with `I` [2]. For example, property `baz` is missing in object literal [1] but exists in `{baz: string, ...}` [2]. [incompatible-type] declare_type_only_export_usage.js:4:2 4| ({}) as I; // ERROR - missing baz ^^ [1] References: declare_type_only_export_usage.js:4:9 4| ({}) as I; // ERROR - missing baz ^ [2] Error ------------------------------------------------------------------------------------- declare_var_multiple.js:11:1 Cannot cast `x` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] declare_var_multiple.js:11:1 11| x as number; // ERROR ^ References: declare_var_multiple.js:1:18 1| declare const x: string, y: number; ^^^^^^ [1] declare_var_multiple.js:11:6 11| x as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------- destructuring_function_type_usage.js:6:1 Cannot cast `f(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:6:1 6| f({a: 1, b: "hello"}) as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:2:60 2| export declare function f({a, b}: {a: number, b: string}): number; ^^^^^^ [1] destructuring_function_type_usage.js:6:26 6| f({a: 1, b: "hello"}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:10:1 Cannot cast `g(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:10:1 10| g({a: 1}) as string; // ERROR ^^^^^^^^^ References: destructuring_function_type.d.ts:4:49 4| export declare function g({a: b}: {a: number}): number; ^^^^^^ [1] destructuring_function_type_usage.js:10:14 10| g({a: 1}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:14:1 Cannot cast `h(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:14:1 14| h([1, "hello"]) as string; // ERROR ^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:6:54 6| export declare function h([a, b]: [number, string]): number; ^^^^^^ [1] destructuring_function_type_usage.js:14:20 14| h([1, "hello"]) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:18:1 Cannot cast `nested(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:18:1 18| nested({a: {b: 1}}) as string; // ERROR ^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:8:61 8| export declare function nested({a: {b}}: {a: {b: number}}): number; ^^^^^^ [1] destructuring_function_type_usage.js:18:24 18| nested({a: {b: 1}}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:22:1 Cannot cast `rest(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:22:1 22| rest({a: 1, c: "hello", d: true}) as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:10:78 10| export declare function rest({a, ...b}: {a: number, c: string, d: boolean}): number; ^^^^^^ [1] destructuring_function_type_usage.js:22:38 22| rest({a: 1, c: "hello", d: true}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:27:1 Cannot cast `optObj(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:27:1 27| optObj({a: 1}) as string; // ERROR ^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:12:52 12| export declare function optObj({a}?: {a: number}): number; ^^^^^^ [1] destructuring_function_type_usage.js:27:19 27| optObj({a: 1}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:32:1 Cannot cast `optArr(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:32:1 32| optArr([1]) as string; // ERROR ^^^^^^^^^^^ References: destructuring_function_type.d.ts:14:49 14| export declare function optArr([a]?: [number]): number; ^^^^^^ [1] destructuring_function_type_usage.js:32:16 32| optArr([1]) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:37:1 Cannot cast `c.m(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:37:1 37| c.m({a: 1, b: "hello"}) as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:17:38 17| m({a, b}: {a: number, b: string}): number; ^^^^^^ [1] destructuring_function_type_usage.js:37:28 37| c.m({a: 1, b: "hello"}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:39:1 Cannot cast `c.n(...)` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] destructuring_function_type_usage.js:39:1 39| c.n([1]) as number; // ERROR ^^^^^^^^ References: destructuring_function_type.d.ts:18:21 18| n([a]: [number]): string; ^^^^^^ [1] destructuring_function_type_usage.js:39:13 39| c.n([1]) as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:42:1 Cannot cast `c.o(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:42:1 42| c.o({a: 1}) as string; // ERROR ^^^^^^^^^^^ References: destructuring_function_type.d.ts:19:25 19| o({a}?: {a: number}): number; ^^^^^^ [1] destructuring_function_type_usage.js:42:16 42| c.o({a: 1}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:47:1 Cannot cast `i.m(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:47:1 47| i.m({a: 1, b: "hello"}) as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:23:38 23| m({a, b}: {a: number, b: string}): number; ^^^^^^ [1] destructuring_function_type_usage.js:47:28 47| i.m({a: 1, b: "hello"}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:49:1 Cannot cast `i.n(...)` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] destructuring_function_type_usage.js:49:1 49| i.n([1]) as number; // ERROR ^^^^^^^^ References: destructuring_function_type.d.ts:24:21 24| n([a]: [number]): string; ^^^^^^ [1] destructuring_function_type_usage.js:49:13 49| i.n([1]) as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:53:1 Cannot cast `restArr(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:53:1 53| restArr(1, "hello") as string; // ERROR ^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:27:63 27| export declare function restArr(...[a, b]: [number, string]): number; ^^^^^^ [1] destructuring_function_type_usage.js:53:24 53| restArr(1, "hello") as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:58:1 Cannot cast `arrowObj(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:58:1 58| arrowObj({a: 1, b: "hello"}) as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:29:68 29| export type ArrowDestructObj = ({a, b}: {a: number, b: string}) => number; ^^^^^^ [1] destructuring_function_type_usage.js:58:33 58| arrowObj({a: 1, b: "hello"}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:62:1 Cannot cast `arrowArr(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:62:1 62| arrowArr([1, "hello"]) as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:30:62 30| export type ArrowDestructArr = ([a, b]: [number, string]) => number; ^^^^^^ [1] destructuring_function_type_usage.js:62:27 62| arrowArr([1, "hello"]) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:66:1 Cannot cast `arrowRename(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:66:1 66| arrowRename({x: 1}) as string; // ERROR ^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:31:61 31| export type ArrowDestructRename = ({x: x1}: {x: number}) => number; ^^^^^^ [1] destructuring_function_type_usage.js:66:24 66| arrowRename({x: 1}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:71:1 Cannot cast `arrowNamedObj(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:71:1 71| arrowNamedObj({a: 1, b: "hello"}) as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:35:60 35| export type ArrowDestructNamedObj = ({a, b}: ObjParams) => number; ^^^^^^ [1] destructuring_function_type_usage.js:71:38 71| arrowNamedObj({a: 1, b: "hello"}) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:75:1 Cannot cast `arrowNamedArr(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:75:1 75| arrowNamedArr([1, "hello"]) as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:36:62 36| export type ArrowDestructNamedArr = ([a, b]: TupleParams) => number; ^^^^^^ [1] destructuring_function_type_usage.js:75:32 75| arrowNamedArr([1, "hello"]) as string; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------ destructuring_function_type_usage.js:78:1 Cannot cast `arrowDestructNamedConst(...)` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] destructuring_function_type_usage.js:78:1 78| arrowDestructNamedConst({a: 1, b: "hello"}) as string; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ References: destructuring_function_type.d.ts:37:70 37| export declare const arrowDestructNamedConst: ({a, b}: ObjParams) => number; ^^^^^^ [1] destructuring_function_type_usage.js:78:48 78| arrowDestructNamedConst({a: 1, b: "hello"}) as string; // ERROR ^^^^^^ [2] Error --------------------------------------------------------------------------------------- export_as_namespace.js:1:1 `export as namespace` may only appear in declaration files. [unsupported-syntax] 1| export as namespace Foo; // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^ Error -------------------------------------------------------------------------- exported_interface_merging_usage.js:8:1 Cannot cast `tippy.a` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] exported_interface_merging_usage.js:8:1 8| tippy.a as string; // ERROR ^^^^^^^ References: exported_interface_merging.d.ts:2:28 2| export interface Tippy { a: T } // OK ^^^^^^ [1] exported_interface_merging_usage.js:8:12 8| tippy.a as string; // ERROR ^^^^^^ [2] Error -------------------------------------------------------------------------- exported_interface_merging_usage.js:9:1 Cannot cast `tippy.b` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] exported_interface_merging_usage.js:9:1 9| tippy.b as number; // ERROR ^^^^^^^ References: exported_interface_merging.d.ts:3:41 3| export interface Tippy { b: string } // OK ^^^^^^ [1] exported_interface_merging_usage.js:9:12 9| tippy.b as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------- exported_interface_merging_usage.js:16:1 Cannot cast `generic.a` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] exported_interface_merging_usage.js:16:1 16| generic.a as number; // ERROR ^^^^^^^^^ References: exported_interface_merging_usage.js:12:30 12| declare const generic: Tippy; ^^^^^^ [1] exported_interface_merging_usage.js:16:14 16| generic.a as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------- exported_interface_merging_usage.js:22:1 Cannot cast `control.a` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] exported_interface_merging_usage.js:22:1 22| control.a as string; // ERROR ^^^^^^^^^ References: exported_interface_merging.d.ts:7:24 7| interface Control { a: number } // OK ^^^^^^ [1] exported_interface_merging_usage.js:22:14 22| control.a as string; // ERROR ^^^^^^ [2] Error ----------------------------------------------------------------------------------- generic_tagged_template.js:4:1 Cannot cast `` tag`...` `` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] generic_tagged_template.js:4:1 4| tag`hello` as empty; // ERROR ^^^^^^^^^^^^^^^^^^ References: generic_tagged_template.js:4:5 4| tag`hello` as empty; // ERROR ^^^^^^ [1] generic_tagged_template.js:4:23 4| tag`hello` as empty; // ERROR ^^^^^ [2] Error ------------------------------------------------------------------------- interface_method_no_return_usage.js:16:1 Cannot cast `i4.m()` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] interface_method_no_return_usage.js:16:1 16| i4.m() as string; // ERROR — number ~> string (explicit return still respected) ^^^^^^ References: interface_method_no_return.d.ts:19:8 19| m(): number; ^^^^^^ [1] interface_method_no_return_usage.js:16:11 16| i4.m() as string; // ERROR — number ~> string (explicit return still respected) ^^^^^^ [2] Error ------------------------------------------------------------------------------------------- mapped_type_as.js:13:3 Cannot get `w.b` because property `b` is missing in `{a: O["a"]}` [1]. [prop-missing] mapped_type_as.js:13:3 13| w.b; // ERROR - missing ^ References: mapped_type_as.js:11:18 11| declare const w: WithoutB; ^^^^^^^^ [1] Error ------------------------------------------------------------------------------------------- mapped_type_as.js:20:3 Cannot get `s.a` because property `a` is missing in `{b: {a: number, b: string, c: string}["b"], c: {a: number, b: string, c: string}["c"]}` [1]. [prop-missing] mapped_type_as.js:20:3 20| s.a; // ERROR - missing ^ References: mapped_type_as.js:18:18 18| declare const s: S; ^ [1] Error ------------------------------------------------------------------------------------------- mapped_type_as.js:26:1 Cannot cast `sa.X` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] mapped_type_as.js:26:1 26| sa.X as number; // ERROR ^^^^ References: mapped_type_as.js:23:37 23| type Same = {[K in keyof O as 'X']: O[K]}; ^^^^ [1] mapped_type_as.js:26:9 26| sa.X as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------------------- mapped_type_as.js:33:4 Cannot get `ra.a` because property `a` is missing in `{AA: O["a"], b: O["b"]}` [1]. [prop-missing] mapped_type_as.js:33:4 33| ra.a; // ERROR - renamed away ^ References: mapped_type_as.js:30:19 30| declare const ra: RenameA; ^^^^^^^ [1] Error ------------------------------------------------------------------------------------------- mapped_type_as.js:41:4 Cannot get `ix.a` because property `a` is missing in `{X: O["a"], Y: O["b"]}` [1]. [prop-missing] mapped_type_as.js:41:4 41| ix.a; // ERROR - renamed away ^ References: mapped_type_as.js:38:19 38| declare const ix: Indexed; ^^^^^^^ [1] Error ------------------------------------------------------------------------------------------- mapped_type_as.js:47:4 Cannot get `ev.a` because property `a` is missing in `{}` [1]. [prop-missing] mapped_type_as.js:47:4 47| ev.a; // ERROR - missing ^ References: mapped_type_as.js:45:19 45| declare const ev: Empty; ^^^^^ [1] Error ------------------------------------------------------------------------------------------- mapped_type_as.js:65:3 Cannot assign `5` to `f.a` because property `a` is not writable. [cannot-write] 65| f.a = 5; // ERROR - readonly ^ Error ------------------------------------------------------------------------------------------- mapped_type_as.js:81:5 Cannot assign `1` to `cro.X` because property `X` is not writable. [cannot-write] 81| cro.X = 1; // ERROR - readonly survives the collision ^ Error ------------------------------------------------------------------------------------------- mapped_type_as.js:88:4 Cannot get `nh.a` because property `a` is missing in `{A: "a", b: "b"}` [1]. [prop-missing] mapped_type_as.js:88:4 88| nh.a; // ERROR - renamed ^ References: mapped_type_as.js:85:19 85| declare const nh: NonHomo; ^^^^^^^ [1] Error ------------------------------------------------------------------------------------------ mapped_type_as.js:100:4 Cannot get `dr.foo` because property `foo` is missing in `{}` [1]. [prop-missing] mapped_type_as.js:100:4 100| dr.foo; // ERROR ^^^ References: mapped_type_as.js:98:19 98| declare const dr: Drop; ^^^^ [1] Error ----------------------------------------------------------------------------------------- mapped_type_as.js:108:49 Cannot assign `ii` to `_ii_exact_bad` because inexact `{a: InexactSrc["a"], b: InexactSrc["b"], ...}` [1] is incompatible with exact `{a: number, b: string}` [2]. [incompatible-exact] mapped_type_as.js:108:49 108| const _ii_exact_bad: { a: number, b: string } = ii; // ERROR - source was inexact ^^ References: mapped_type_as.js:106:19 106| declare const ii: IdentityInexact; ^^^^^^^^^^^^^^^ [1] mapped_type_as.js:108:22 108| const _ii_exact_bad: { a: number, b: string } = ii; // ERROR - source was inexact ^^^^^^^^^^^^^^^^^^^^^^^^ [2] Error ------------------------------------------------------------------------------------------ mapped_type_as.js:116:4 Cannot get `ci.notThere` because property `notThere` is missing in `{X: InexactSrc["a"] | InexactSrc["b"]}` [1]. [prop-missing] mapped_type_as.js:116:4 116| ci.notThere; // ERROR - source's open shape did not propagate ^^^^^^^^ References: mapped_type_as.js:113:19 113| declare const ci: ConstInexact; ^^^^^^^^^^^^ [1] Error ----------------------------------------------------------------------------------------- mapped_type_as.js:125:15 Key remapping (`as`) on tuple/array sources is not yet supported in mapped types. [unsupported-syntax] 125| type TupRen = {[K in keyof [string, number] as K]: [string, number][K]}; // ERROR - v1 limitation ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Error ------------------------------------------------------------------------------- mapped_type_minus_optional.js:14:3 Cannot assign `'x'` to `f.bar` because property `bar` is not writable. [cannot-write] 14| f.bar = 'x'; // ERROR - readonly ^^^ Error ----------------------------------------------------------------------------------- mapped_type_variance_op.js:7:5 Cannot assign `3` to `pro.foo` because property `foo` is not writable. [cannot-write] 7| pro.foo = 3; // ERROR - writing to +readonly property ^^^ Error ---------------------------------------------------------------------------------- mapped_type_variance_op.js:26:6 Cannot assign `3` to `pror.foo` because property `foo` is not writable. [cannot-write] 26| pror.foo = 3; // ERROR - writing to readonly property ^^^ Error --------------------------------------------------------------------------------- mapped_type_variance_op.js:31:21 Cannot instantiate `MutableFromWO` because an index signature declaring the expected key / value type is not readable. [cannot-read] 31| declare const mfwo: MutableFromWO; // ERROR - input props are not readable ^^^^^^^^^^^^^^^^^^^^^^^^^ Error ---------------------------------------------------------------------------------- mapped_type_variance_op.js:32:6 Cannot get `mfwo.foo` because property `foo` is not readable. [cannot-read] 32| mfwo.foo as number; // ERROR - still writeonly, can't read ^^^ Error -------------------------------------------------------------------------------------- mixin_class_extends.js:4:25 Cannot use `Mixin(...)` [1] as a superclass. Only variables and member expressions may be extended [invalid-extends] 4| class MixinTest extends Mixin(Base) {} // ERROR ^^^^^^^^^^^ [1] Error -------------------------------------------------------------------------------------- mixin_class_extends.js:5:37 Call expression in class `extends` clause is not enabled. [unsupported-syntax] 5| declare class DeclMixinTest extends Mixin(Base) {} // ERROR ^^^^^^^^^^^ Error --------------------------------------------------------------------------- object_construct_sig_lib_usage.js:6:18 Cannot call `TsCtorGlobal` with `1` bound to `init` because `1` [1] is incompatible with `string` [2]. [incompatible-type] object_construct_sig_lib_usage.js:6:18 6| new TsCtorGlobal(1); // ERROR — number ~> string ^ [1] References: object_construct_sig_lib.d.ts:11:17 11| new (init?: string): TsCtorGlobal; ^^^^^^ [2] Error ---------------------------------------------------------------------------- object_construct_sig_lib_usage.js:8:5 Cannot use `new` on `{new(): TsCtorGlobal}` [1]. Only classes and interfaces with a construct signature can be constructed. [invalid-constructor] object_construct_sig_lib_usage.js:8:5 8| new TsCtorGlobalQuoted(); // ERROR: invalid-constructor ^^^^^^^^^^^^^^^^^^ References: object_construct_sig_lib.d.ts:14:33 v 14| declare var TsCtorGlobalQuoted: { 15| "new"(): TsCtorGlobal; 16| }; ^ [1] Error ------------------------------------------------------------------------------ object_construct_sig_usage.js:25:13 Cannot call `BarCtor` with `1` bound to `x` because `1` [1] is incompatible with `string` [2]. [incompatible-type] object_construct_sig_usage.js:25:13 25| new BarCtor(1); // ERROR — number ~> string ^ [1] References: object_construct_sig.d.ts:10:13 10| new (x: string): Bar; ^^^^^^ [2] Error ------------------------------------------------------------------------------- object_construct_sig_usage.js:26:5 Cannot call `BarCtor` because `(x: string) => Bar` [1] requires another argument. [incompatible-type] object_construct_sig_usage.js:26:5 26| new BarCtor(); // ERROR — too few arguments ^^^^^^^ References: object_construct_sig.d.ts:10:5 10| new (x: string): Bar; ^^^^^^^^^^^^^^^^^^^^ [1] Error ------------------------------------------------------------------------------- object_construct_sig_usage.js:27:1 Cannot cast `(new BarCtor(...)).b` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] object_construct_sig_usage.js:27:1 27| new BarCtor('x').b as number; // ERROR — string ~> number ^^^^^^^^^^^^^^^^^^ References: object_construct_sig.d.ts:5:8 5| b: string; ^^^^^^ [1] object_construct_sig_usage.js:27:23 27| new BarCtor('x').b as number; // ERROR — string ~> number ^^^^^^ [2] Error ------------------------------------------------------------------------------- object_construct_sig_usage.js:34:1 Cannot cast `WrongCtor` to `Class` because in the return value: `Wrong` [1] is incompatible with `Bar` [2]. For example, property `b` is missing in `Wrong` [1] but exists in `Bar` [2]. [incompatible-type] object_construct_sig_usage.js:34:1 34| WrongCtor as Class; // ERROR: the construct signature returns Wrong, not Bar. ^^^^^^^^^ References: object_construct_sig.d.ts:22:13 22| new (): Wrong; ^^^^^ [1] object_construct_sig_usage.js:34:20 34| WrongCtor as Class; // ERROR: the construct signature returns Wrong, not Bar. ^^^ [2] Error ------------------------------------------------------------------------------- object_construct_sig_usage.js:40:5 Cannot call `Multi` because: [incompatible-type] - Either `true` [1] is incompatible with `string` [2]. - Or `true` [1] is incompatible with `number` [3]. object_construct_sig_usage.js:40:5 40| new Multi(true); // ERROR — neither overload accepts boolean ^^^^^ References: object_construct_sig_usage.js:40:11 40| new Multi(true); // ERROR — neither overload accepts boolean ^^^^ [1] object_construct_sig.d.ts:39:13 39| new (x: string): Str; ^^^^^^ [2] object_construct_sig.d.ts:40:13 40| new (x: number): Num; ^^^^^^ [3] Error ------------------------------------------------------------------------------- object_construct_sig_usage.js:42:1 Cannot cast `Multi` to `Class` because: [incompatible-type] - Either in the return value: property `b` is missing in `Str` [1] but exists in `Bar` [2]. - Or in the return value: property `b` is missing in `Num` [3] but exists in `Bar` [2]. object_construct_sig_usage.js:42:1 42| Multi as Class; // ERROR: no construct overload returns Bar. ^^^^^ References: object_construct_sig.d.ts:39:22 39| new (x: string): Str; ^^^ [1] object_construct_sig_usage.js:42:16 42| Multi as Class; // ERROR: no construct overload returns Bar. ^^^ [2] object_construct_sig.d.ts:40:22 40| new (x: number): Num; ^^^ [3] Error ------------------------------------------------------------------------------ object_construct_sig_usage.js:65:17 Cannot call `createViaObject` with `Plain` bound to `C` because property `new` is missing in `interface {new(): Bar}` [1] but exists in `{new(): any}` [2]. [incompatible-type] object_construct_sig_usage.js:65:17 65| createViaObject(Plain); // ERROR — `{new(): T}` in a Flow file is not a construct signature ^^^^^ References: object_construct_sig.d.ts:15:29 15| export declare const Plain: {new (): Bar}; ^^^^^^^^^^^^^ [1] object_construct_sig_usage.js:64:40 64| declare function createViaObject(C: {new (): T}): T; ^^^^^^^^^^^ [2] Error ------------------------------------------------------------------------------- object_construct_sig_usage.js:69:5 Cannot use `new` on `{new(): Bar}` [1]. Only classes and interfaces with a construct signature can be constructed. [invalid-constructor] object_construct_sig_usage.js:69:5 69| new Quoted(); // ERROR: invalid-constructor ^^^^^^ References: object_construct_sig.d.ts:57:30 57| export declare const Quoted: {"new"(): Bar}; ^^^^^^^^^^^^^^ [1] Error ------------------------------------------------------------------------------- object_construct_sig_usage.js:70:5 Cannot use `new` on `{new?: () => Bar}` [1]. Only classes and interfaces with a construct signature can be constructed. [invalid-constructor] object_construct_sig_usage.js:70:5 70| new OptionalMethod(); // ERROR: invalid-constructor ^^^^^^^^^^^^^^ References: object_construct_sig.d.ts:58:38 58| export declare const OptionalMethod: {new?(): Bar}; ^^^^^^^^^^^^^ [1] Error ------------------------------------------------------------------------------- object_construct_sig_usage.js:72:5 Cannot use `new` on `{new: () => Bar}` [1]. Only classes and interfaces with a construct signature can be constructed. [invalid-constructor] object_construct_sig_usage.js:72:5 72| new Field(); // ERROR: invalid-constructor ^^^^^ References: object_construct_sig.d.ts:59:29 59| export declare const Field: {new: () => Bar}; ^^^^^^^^^^^^^^^^ [1] Error ------------------------------------------------------------------------------------ optional_class_field.js:13:12 Cannot return `this.#label` because `void` [1] is incompatible with `string` [2]. [incompatible-type] optional_class_field.js:13:12 13| return this.#label; // ERROR ^^^^^^^^^^^ References: optional_class_field.js:5:12 5| #label?: string; ^^^^^^ [1] optional_class_field.js:12:24 12| readLabelAsString(): string { ^^^^^^ [2] Error ------------------------------------------------------------------------------------- optional_class_field.js:19:3 Cannot cast `box.value` to `number` because `void` [1] is incompatible with `number` [2]. [incompatible-type] optional_class_field.js:19:3 19| box.value as number; // ERROR ^^^^^^^^^ References: optional_class_field.js:4:11 4| value?: number; ^^^^^^ [1] optional_class_field.js:19:16 19| box.value as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------------- optional_class_field.js:28:3 Cannot cast `Box.count` to `number` because `void` [1] is incompatible with `number` [2]. [incompatible-type] optional_class_field.js:28:3 28| Box.count as number; // ERROR ^^^^^^^^^ References: optional_class_field.js:6:18 6| static count?: number; ^^^^^^ [1] optional_class_field.js:28:16 28| Box.count as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------------- optional_class_field.js:33:3 Cannot cast `exported.value` to `number` because `void` [1] is incompatible with `number` [2]. [incompatible-type] optional_class_field.js:33:3 33| exported.value as number; // ERROR ^^^^^^^^^^^^^^ References: optional_class_field_exported.js:2:11 2| value?: number; ^^^^^^ [1] optional_class_field.js:33:21 33| exported.value as number; // ERROR ^^^^^^ [2] Error ------------------------------------------------------------------------------------- optional_class_field.js:41:3 Cannot cast `box.value` to `number` because `void` [1] is incompatible with `number` [2]. [incompatible-type] optional_class_field.js:41:3 41| box.value as number; // ERROR ^^^^^^^^^ References: optional_class_field.js:37:11 37| value?: number = 1; ^^^^^^ [1] optional_class_field.js:41:16 41| box.value as number; // ERROR ^^^^^^ [2] Error ---------------------------------------------------------------------------------- optional_class_property.js:10:1 Cannot cast `foo.a` to `empty` because `string` [1] is incompatible with `empty` [2]. [incompatible-type] optional_class_property.js:10:1 10| foo.a as empty; // ERROR ^^^^^ References: optional_class_property.js:2:7 2| a?: string; ^^^^^^ [1] optional_class_property.js:10:10 10| foo.a as empty; // ERROR ^^^^^ [2] Error ---------------------------------------------------------------------------------- optional_class_property.js:10:1 Cannot cast `foo.a` to `empty` because `void` [1] is incompatible with `empty` [2]. [incompatible-type] optional_class_property.js:10:1 10| foo.a as empty; // ERROR ^^^^^ References: optional_class_property.js:2:7 2| a?: string; ^^^^^^ [1] optional_class_property.js:10:10 10| foo.a as empty; // ERROR ^^^^^ [2] Error --------------------------------------------------------------------- private_unannotated_class_field_usage.js:5:3 Cannot get `t.cache` because property `cache` is missing in `ThemeCache` [1]. [prop-missing] private_unannotated_class_field_usage.js:5:3 5| t.cache; // ERROR: prop-missing (private not in public type) ^^^^^ References: private_unannotated_class_field_usage.js:3:11 3| const t = new ThemeCache(); ^^^^^^^^^^^^^^^^ [1] Error ----------------------------------------------------------------------------------- rest_destructuring_flow.js:8:6 Cannot call `rest.next` because: [incompatible-type] - Either in index `0`: `1` [1] is incompatible with `string` [2]. - Or `[1]` [3] has 1 element but `Readonly<[]>` [4] has 0 elements. Flow is showing the union/intersection branches that got closest to passing. Other branches were less compatible and are not shown. To see all branches, re-run Flow with --show-all-branches. rest_destructuring_flow.js:8:6 8| rest.next(1); // ERROR ^^^^ References: rest_destructuring_flow.js:8:11 8| rest.next(1); // ERROR ^ [1] rest_destructuring_flow.js:5:38 5| declare const rest: DestructuredRest; ^^^^^^ [2] rest_destructuring_flow.js:8:1 8| rest.next(1); // ERROR ^^^^^^^^^^^^ [3] rest_destructuring_flow.js:2:20 2| next(...[value]: [] | [T]): number; ^^ [4] Error ----------------------------------------------------------------------------------- rest_destructuring_flow.js:9:6 Cannot call `rest.next` because: [incompatible-type] - Either `["first", "second"]` [1] has 2 elements but `Readonly<[]>` [2] has 0 elements. - Or `["first", "second"]` [1] has 2 elements but `[string]` [3] has 1 element. rest_destructuring_flow.js:9:6 9| rest.next('first', 'second'); // ERROR ^^^^ References: rest_destructuring_flow.js:9:1 9| rest.next('first', 'second'); // ERROR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [1] rest_destructuring_flow.js:2:20 2| next(...[value]: [] | [T]): number; ^^ [2] rest_destructuring_flow.js:2:25 2| next(...[value]: [] | [T]): number; ^^^ [3] Error ---------------------------------------------------------------------------------- rest_destructuring_flow.js:13:6 Cannot call `pair` because in index `0`: `"value"` [1] is incompatible with `number` [2]. [incompatible-type] rest_destructuring_flow.js:13:6 13| pair('value', 1); // ERROR ^^^^^^^ [1] References: rest_destructuring_flow.js:11:43 11| declare const pair: (...[first, second]: [number, string]) => number; ^^^^^^ [2] Error --------------------------------------------------------------------------------- rest_destructuring_flow.js:13:15 Cannot call `pair` because in index `1`: `1` [1] is incompatible with `string` [2]. [incompatible-type] rest_destructuring_flow.js:13:15 13| pair('value', 1); // ERROR ^ [1] References: rest_destructuring_flow.js:11:51 11| declare const pair: (...[first, second]: [number, string]) => number; ^^^^^^ [2] Error ---------------------------------------------------------------------------------- rest_destructuring_flow.js:14:1 Cannot call `pair` because `[1]` [1] has 1 element but `[number, string]` [2] has 2 elements. [invalid-tuple-arity] rest_destructuring_flow.js:14:1 14| pair(1); // ERROR ^^^^ References: rest_destructuring_flow.js:14:1 14| pair(1); // ERROR ^^^^^^^ [1] rest_destructuring_flow.js:11:42 11| declare const pair: (...[first, second]: [number, string]) => number; ^^^^^^^^^^^^^^^^ [2] Error --------------------------------------------------------------------------------- rest_destructuring_flow.js:18:11 Cannot call `anonymous` because in index `0`: `"value"` [1] is incompatible with `number` [2]. [incompatible-type] rest_destructuring_flow.js:18:11 18| anonymous('value', 1); // ERROR ^^^^^^^ [1] References: rest_destructuring_flow.js:16:37 16| declare const anonymous: (...args: [number, string]) => number; ^^^^^^ [2] Error --------------------------------------------------------------------------------- rest_destructuring_flow.js:18:20 Cannot call `anonymous` because in index `1`: `1` [1] is incompatible with `string` [2]. [incompatible-type] rest_destructuring_flow.js:18:20 18| anonymous('value', 1); // ERROR ^ [1] References: rest_destructuring_flow.js:16:45 16| declare const anonymous: (...args: [number, string]) => number; ^^^^^^ [2] Error --------------------------------------------------------------------------- shorthand_ambient_module_usage.js:3:10 Cannot import `value` because there is no `value` export in `shorthand-explicit`. Did you mean `import value from "..."`? [missing-export] 3| import { value as explicitValue } from 'shorthand-explicit'; // ERROR ^^^^^ Error --------------------------------------------------------------------------- shorthand_ambient_module_usage.js:4:10 Cannot import `value` because there is no `value` export in `shorthand-implicit`. Did you mean `import value from "..."`? [missing-export] 4| import { value as implicitValue } from 'shorthand-implicit'; // ERROR ^^^^^ Error --------------------------------------------------------------------------- shorthand_ambient_module_usage.js:5:10 Cannot import `value` because there is no `value` export in `shorthand-empty-body`. Did you mean `import value from "..."`? [missing-export] 5| import { value as emptyBodyValue } from 'shorthand-empty-body'; // ERROR ^^^^^ Error ---------------------------------------------------------------------------- shorthand_ambient_module_usage.js:8:1 Cannot cast `Explicit` to `number` because `{}` [1] is incompatible with `number` [2]. [incompatible-type] shorthand_ambient_module_usage.js:8:1 8| Explicit as number; // ERROR ^^^^^^^^ References: shorthand_ambient_module.d.ts:1:16 1| declare module 'shorthand-explicit'; ^^^^^^^^^^^^^^^^^^^^ [1] shorthand_ambient_module_usage.js:8:13 8| Explicit as number; // ERROR ^^^^^^ [2] Error --------------------------------------------------------------------------- shorthand_ambient_module_usage.js:9:19 Cannot get `explicitNamespace.value` because property `value` is missing in `{readonly default: {}}` [1]. [missing-export] shorthand_ambient_module_usage.js:9:19 9| explicitNamespace.value; // ERROR ^^^^^ References: shorthand_ambient_module.d.ts:1:16 1| declare module 'shorthand-explicit'; ^^^^^^^^^^^^^^^^^^^^ [1] Error --------------------------------------------------------------------------------- ts_interop_arrays_usage.js:12:20 Cannot call `acceptsFlowStrings` with `flowTuple` bound to `values` because `[string, string]` [1] is incompatible with `Array` [2]. [incompatible-type] ts_interop_arrays_usage.js:12:20 12| acceptsFlowStrings(flowTuple); // ERROR ^^^^^^^^^ References: ts_interop_arrays_usage.js:3:18 3| const flowTuple: [string, string] = ['a', 'b']; ^^^^^^^^^^^^^^^^ [1] ts_interop_arrays_usage.js:9:37 9| function acceptsFlowStrings(values: Array): void {} ^^^^^^^^^^^^^ [2] Error --------------------------------------------------------------------------------- ts_interop_arrays_usage.js:13:25 Cannot call `acceptsFlowStringArrays` with `flowTupleArray` bound to `values` because in array element: `[string, string]` [1] is not exactly the same as `Array` [2]. [incompatible-type] The above-mentioned two types must be the same because arrays are invariantly typed. To fix the error, - Either make `Array<[string, string]>` [3] and `Array>` [4] exactly the same - Or make `Array>` [4] a `ReadonlyArray`. See https://flow.org/en/docs/faq/#why-cant-i-pass-an-arraystring-to-a-function-that-takes-an-arraystring-number. ts_interop_arrays_usage.js:13:25 13| acceptsFlowStringArrays(flowTupleArray); // ERROR ^^^^^^^^^^^^^^ References: ts_interop_arrays_usage.js:4:29 4| const flowTupleArray: Array<[string, string]> = [flowTuple]; ^^^^^^^^^^^^^^^^ [1] ts_interop_arrays_usage.js:10:48 10| function acceptsFlowStringArrays(values: Array>): void {} ^^^^^^^^^^^^^ [2] ts_interop_arrays_usage.js:4:23 4| const flowTupleArray: Array<[string, string]> = [flowTuple]; ^^^^^^^^^^^^^^^^^^^^^^^ [3] ts_interop_arrays_usage.js:10:42 10| function acceptsFlowStringArrays(values: Array>): void {} ^^^^^^^^^^^^^^^^^^^^ [4] Error -------------------------------------------------------------------------------- type_keyword_dotted_access.js:7:1 Cannot cast `x` to `empty` because `infer` [1] is incompatible with `empty` [2]. [incompatible-type] type_keyword_dotted_access.js:7:1 7| x as empty; // ERROR ^ References: type_keyword_dotted_access.js:5:18 5| declare const x: N.infer; ^^^^^^^ [1] type_keyword_dotted_access.js:7:6 7| x as empty; // ERROR ^^^^^ [2] Error ---------------------------------------------------------------------------------------------- typeof_this.js:15:1 Cannot cast `obj.method()` to `empty` because `MyClass` [1] is incompatible with `empty` [2]. [incompatible-type] typeof_this.js:15:1 15| obj.method() as empty; // ERROR ^^^^^^^^^^^^ References: typeof_this.js:5:13 5| method(): typeof this { ^^^^^^^^^^^ [1] typeof_this.js:15:17 15| obj.method() as empty; // ERROR ^^^^^ [2] Error ---------------------------------------------------------------------------------------------- typeof_this.js:16:1 Cannot cast `obj.getX()` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] typeof_this.js:16:1 16| obj.getX() as empty; // ERROR ^^^^^^^^^^ References: typeof_this.js:9:11 9| getX(): typeof this.x { ^^^^^^^^^^^^^ [1] typeof_this.js:16:15 16| obj.getX() as empty; // ERROR ^^^^^ [2] Error --------------------------------------------------------------------------------------------- unique_symbol.js:8:1 Cannot cast `x` to `empty` because unique symbol [1] is incompatible with `empty` [2]. [incompatible-type] unique_symbol.js:8:1 8| x as empty; // ERROR ^ References: unique_symbol.js:1:18 1| declare const x: unique symbol; ^^^^^^^^^^^^^ [1] unique_symbol.js:8:6 8| x as empty; // ERROR ^^^^^ [2] Error -------------------------------------------------------------------------------------------- unique_symbol.js:12:1 Cannot cast `s` to `unique symbol` because `symbol` [1] is incompatible with unique symbol [2]. [incompatible-type] unique_symbol.js:12:1 12| s as typeof x; // ERROR - symbol doesn't flow to unique symbol ^ References: unique_symbol.js:11:18 11| declare const s: symbol; ^^^^^^ [1] unique_symbol.js:12:6 12| s as typeof x; // ERROR - symbol doesn't flow to unique symbol ^^^^^^^^ [2] Error -------------------------------------------------------------------------------------------- unique_symbol.js:15:1 Cannot cast `y` to `unique symbol` because unique symbol [1] is incompatible with unique symbol [2]. [incompatible-type] unique_symbol.js:15:1 15| y as typeof x; // ERROR - different unique symbols are incompatible ^ References: unique_symbol.js:2:18 2| declare const y: unique symbol; ^^^^^^^^^^^^^ [1] unique_symbol.js:15:6 15| y as typeof x; // ERROR - different unique symbols are incompatible ^^^^^^^^ [2] Error -------------------------------------------------------------------------------------------- unique_symbol.js:40:8 Cannot call `takesX` with `y` bound to `s` because unique symbol [1] is incompatible with unique symbol [2]. [incompatible-type] unique_symbol.js:40:8 40| takesX(y); // ERROR - different unique symbol ^ References: unique_symbol.js:2:18 2| declare const y: unique symbol; ^^^^^^^^^^^^^ [1] unique_symbol.js:37:28 37| declare function takesX(s: typeof x): void; ^^^^^^^^ [2] Error -------------------------------------------------------------------------------------------- unique_symbol.js:45:1 Cannot cast `a` to `unique symbol` because unique symbol [1] is incompatible with unique symbol [2]. [incompatible-type] unique_symbol.js:45:1 45| a as typeof y; // ERROR ^ References: unique_symbol.js:43:18 43| declare const a: typeof x; ^^^^^^^^ [1] unique_symbol.js:45:6 45| a as typeof y; // ERROR ^^^^^^^^ [2] Error -------------------------------------------------------------------------------------------- unique_symbol.js:48:1 Cannot cast `x` to `string` because unique symbol [1] is incompatible with `string` [2]. [incompatible-type] unique_symbol.js:48:1 48| x as string; // ERROR ^ References: unique_symbol.js:1:18 1| declare const x: unique symbol; ^^^^^^^^^^^^^ [1] unique_symbol.js:48:6 48| x as string; // ERROR ^^^^^^ [2] Error -------------------------------------------------------------------------------------------- unique_symbol.js:49:1 Cannot cast `x` to `number` because unique symbol [1] is incompatible with `number` [2]. [incompatible-type] unique_symbol.js:49:1 49| x as number; // ERROR ^ References: unique_symbol.js:1:18 1| declare const x: unique symbol; ^^^^^^^^^^^^^ [1] unique_symbol.js:49:6 49| x as number; // ERROR ^^^^^^ [2] Error -------------------------------------------------------------------------------------------- unique_symbol.js:50:1 Cannot cast `x` to `boolean` because unique symbol [1] is incompatible with `boolean` [2]. [incompatible-type] unique_symbol.js:50:1 50| x as boolean; // ERROR ^ References: unique_symbol.js:1:18 1| declare const x: unique symbol; ^^^^^^^^^^^^^ [1] unique_symbol.js:50:6 50| x as boolean; // ERROR ^^^^^^^ [2] Error -------------------------------------------------------------------------------------------- unique_symbol.js:55:1 Cannot cast `m` to `unique symbol` because `unknown` [1] is incompatible with unique symbol [2]. [incompatible-type] unique_symbol.js:55:1 55| m as typeof x; // ERROR - mixed doesn't flow to unique symbol ^ References: unique_symbol.js:54:18 54| declare const m: unknown; ^^^^^^^ [1] unique_symbol.js:55:6 55| m as typeof x; // ERROR - mixed doesn't flow to unique symbol ^^^^^^^^ [2] Error --------------------------------------------------------------------------- unique_symbol_key_members_usage.js:9:1 Cannot cast `i[Keys.a]` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] unique_symbol_key_members_usage.js:9:1 9| i[Keys.a] as string; // ERROR: number is incompatible with string ^^^^^^^^^ References: unique_symbol_key_members.d.ts:18:13 18| [Keys.a]: number; ^^^^^^ [1] unique_symbol_key_members_usage.js:9:14 9| i[Keys.a] as string; // ERROR: number is incompatible with string ^^^^^^ [2] Error -------------------------------------------------------------------------- unique_symbol_key_members_usage.js:10:1 Cannot cast `i[Keys.b]` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] unique_symbol_key_members_usage.js:10:1 10| i[Keys.b] as number; // ERROR: string is incompatible with number ^^^^^^^^^ References: unique_symbol_key_members.d.ts:19:13 19| [Keys.b]: string; ^^^^^^ [1] unique_symbol_key_members_usage.js:10:14 10| i[Keys.b] as number; // ERROR: string is incompatible with number ^^^^^^ [2] Error -------------------------------------------------------------------------- unique_symbol_key_members_usage.js:17:1 Cannot cast `w[Keys.b]` to `number` because `boolean` [1] is incompatible with `number` [2]. [incompatible-type] unique_symbol_key_members_usage.js:17:1 17| w[Keys.b] as number; // ERROR: boolean is incompatible with number (b did not merge with a) ^^^^^^^^^ References: unique_symbol_key_members.d.ts:27:13 27| [Keys.b]: boolean; ^^^^^^^ [1] unique_symbol_key_members_usage.js:17:14 17| w[Keys.b] as number; // ERROR: boolean is incompatible with number (b did not merge with a) ^^^^^^ [2] Error -------------------------------------------------------------------------- unique_symbol_key_members_usage.js:23:1 Cannot cast `c[Keys.b]` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] unique_symbol_key_members_usage.js:23:1 23| c[Keys.b] as number; // ERROR: string is incompatible with number ^^^^^^^^^ References: unique_symbol_key_members.d.ts:32:13 32| [Keys.b]: string; ^^^^^^ [1] unique_symbol_key_members_usage.js:23:14 23| c[Keys.b] as number; // ERROR: string is incompatible with number ^^^^^^ [2] Error --------------------------------------------------------------------------------------- unique_symbol_keys.js:19:1 Cannot cast `o[key1]` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] unique_symbol_keys.js:19:1 19| o[key1] as string; // ERROR: number is incompatible with string ^^^^^^^ References: unique_symbol_keys.js:9:11 9| [key1]: 1, ^ [1] unique_symbol_keys.js:19:12 19| o[key1] as string; // ERROR: number is incompatible with string ^^^^^^ [2] Error --------------------------------------------------------------------------------------- unique_symbol_keys.js:20:1 Cannot cast `o[key2]` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] unique_symbol_keys.js:20:1 20| o[key2] as number; // ERROR: string is incompatible with number ^^^^^^^ References: unique_symbol_keys.js:10:11 10| [key2]: "hello", ^^^^^^^ [1] unique_symbol_keys.js:20:12 20| o[key2] as number; // ERROR: string is incompatible with number ^^^^^^ [2] Error --------------------------------------------------------------------------------------- unique_symbol_keys.js:23:3 Cannot get `o[key3]` because property `[symbol]` is missing in object literal [1]. [prop-missing] unique_symbol_keys.js:23:3 23| o[key3]; // ERROR: property is missing ^^^^ References: unique_symbol_keys.js:7:11 v 7| const o = { 8| name: "Alice", 9| [key1]: 1, 10| [key2]: "hello", 11| }; ^ [1] Error --------------------------------------------------------------------------------------- unique_symbol_keys.js:30:1 Cannot cast `d[key1]` to `number` because `boolean` [1] is incompatible with `number` [2]. [incompatible-type] unique_symbol_keys.js:30:1 30| d[key1] as number; // ERROR: boolean is incompatible with number ^^^^^^^ References: unique_symbol_keys.js:27:34 27| type Dict = {[key: typeof key1]: boolean}; ^^^^^^^ [1] unique_symbol_keys.js:30:12 30| d[key1] as number; // ERROR: boolean is incompatible with number ^^^^^^ [2] Error -------------------------------------------------------------------------------------- unique_symbol_keys.js:40:10 Cannot return `o[k]` because `number` [1] is incompatible with `string` [2]. [incompatible-type] unique_symbol_keys.js:40:10 40| return o[k]; // ERROR: number is incompatible with string ^^^^ References: unique_symbol_keys.js:9:11 9| [key1]: 1, ^ [1] unique_symbol_keys.js:39:58 39| function readViaGenericBad(k: K): string { ^^^^^^ [2] Found 131 errors