Error -------------------------------------------------------------------------------------------------- aliases.js:3:14 Cannot assign `"hello world"` to `x` because `"hello world"` [1] is incompatible with `S` [2]. [incompatible-type] aliases.js:3:14 3| const x: T = "hello world"; // err ^^^^^^^^^^^^^ [1] References: aliases.js:3:10 3| const x: T = "hello world"; // err ^ [2] Error -------------------------------------------------------------------------------------------------- aliases.js:7:14 Cannot assign `"hello world"` to `y` because `"hello world"` [1] is incompatible with `S` [2]. [incompatible-type] aliases.js:7:14 7| const y: A = "hello world"; // err ^^^^^^^^^^^^^ [1] References: aliases.js:7:10 7| const y: A = "hello world"; // err ^ [2] Error ---------------------------------------------------------------------------------------------------- async.js:4:27 Cannot yield `42` because `number` [1], a primitive, cannot be used as a subtype of `Iterable` [2]. You can wrap it in `new Number(...))` to turn it into an object and attempt to use it as a subtype of an interface. [incompatible-type] async.js:4:27 4| var x = await (yield* 42); // error: number is not iterable ^^ [1] References: /misc.js:295:11 295| interface Iterable {} ^^^^^^^^ [2] Error -------------------------------------------------------------------------------------------------- bindings.js:4:1 Cannot cast `x` to `string` because `number` [1] is incompatible with `string` [2]. [incompatible-type] bindings.js:4:1 4| x as string; // num ` because in array element: `string` [1] is not exactly the same as `number` [2]. [incompatible-type] The above-mentioned two types must be the same because arrays are invariantly typed. To fix the error, - Either make `Array` [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. emp_arr.js:9:1 9| x as Array; ^ References: emp_arr.js:4:10 4| x.push('a'); ^^^ [1] emp_arr.js:9:12 9| x as Array; ^^^^^^ [2] emp_arr.js:7:5 7| var x = []; ^ [3] emp_arr.js:9:6 9| x as Array; ^^^^^^^^^^^^^ [4] Error ----------------------------------------------------------------------------------------------------- enum.js:7:12 Cannot assign `10` to `y` because `10` [1] is incompatible with `W` [2]. [incompatible-type] enum.js:7:12 7| var y: W = 10; // err ^^ [1] References: enum.js:7:8 7| var y: W = 10; // err ^ [2] Error ------------------------------------------------------------------------------------------------------ enum.js:8:8 Cannot use `A` as a type. Enum members are not separate types. Only the enum itself, `W` [1], is a type. [enum-value-as-type] enum.js:8:8 8| var z: W.A; // err ^^^ References: enum.js:2:6 2| enum W { ^ [1] Error ------------------------------------------------------------------------------------------------- function.js:11:9 Cannot compute a type for function because its definition includes references to itself [1]. Please add an annotation to this definition [2] [recursive-definition] function.js:11:9 11| var x = function h() { ^^^^^^^^^^^^ References: function.js:12:3 12| h() as empty; ^ [1] function.js:11:21 11| var x = function h() { [2] Error ------------------------------------------------------------------------------------------------- function.js:16:1 Cannot cast `f()` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] function.js:16:1 16| f() as empty; // err ^^^ References: function.js:8:10 8| return 42; ^^ [1] function.js:16:8 16| f() as empty; // err ^^^^^ [2] Error ------------------------------------------------------------------------------------------------- function.js:17:1 Cannot cast `g()` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] function.js:17:1 17| g() as empty; // err ^^^ References: function.js:8:10 8| return 42; ^^ [1] function.js:17:8 17| g() as empty; // err ^^^^^ [2] Error ------------------------------------------------------------------------------------------------- function.js:28:3 Cannot cast `k()` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] function.js:28:3 28| k() as empty; ^^^ References: function.js:27:23 27| var y = function k(): number { ^^^^^^ [1] function.js:28:10 28| k() as empty; ^^^^^ [2] Error ------------------------------------------------------------------------------------------------- function.js:32:1 Cannot cast `h()` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] function.js:32:1 32| h() as empty; // err ^^^ References: function.js:19:15 19| function h(): number { ^^^^^^ [1] function.js:32:8 32| h() as empty; // err ^^^^^ [2] Error ------------------------------------------------------------------------------------------------- function.js:33:1 Cannot cast `i()` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] function.js:33:1 33| i() as empty; // err ^^^ References: function.js:23:15 23| function i(): number { ^^^^^^ [1] function.js:33:8 33| i() as empty; // err ^^^^^ [2] Error ------------------------------------------------------------------------------------------------ heap_refis.js:6:3 Cannot cast `x.y.z` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] heap_refis.js:6:3 6| x.y.z as empty; //err num ^^^^^ References: heap_refis.js:3:27 3| declare const x: {y?: {z: number, ...}, ...}; ^^^^^^ [1] heap_refis.js:6:12 6| x.y.z as empty; //err num ^^^^^ [2] Error ----------------------------------------------------------------------------------------------- heap_refis.js:17:5 Cannot cast `y` to `empty` because `C` [1] is incompatible with `empty` [2]. [incompatible-type] heap_refis.js:17:5 17| y as empty; // err C ^ References: heap_refis.js:16:20 16| if (y instanceof B.C) { ^^^ [1] heap_refis.js:17:10 17| y as empty; // err C ^^^^^ [2] Error ---------------------------------------------------------------------------------------------- heap_refis.js:23:18 The right-hand side of an `instanceof` expression must be an object, but got undefined (result of null short-circuiting an optional chain) [1]. [invalid-in-rhs] heap_refis.js:23:18 23| if (y instanceof B?.C) { ^ References: heap_refis.js:12:9 12| var B = null; ^^^^ [1] Error ----------------------------------------------------------------------------------------------- heap_refis.js:25:3 Cannot cast `y` to `empty` because `C` [1] is incompatible with `empty` [2]. [incompatible-type] heap_refis.js:25:3 25| y as empty; // err C ^ References: heap_refis.js:23:18 23| if (y instanceof B?.C) { ^^^^ [1] heap_refis.js:25:8 25| y as empty; // err C ^^^^^ [2] Error ------------------------------------------------------------------------------------------ immediate_cycle.js:1:10 Invalid trivially recursive definition of this type. [recursive-definition] 1| const x: X = {}; // error {} ~> empty ^ Error --------------------------------------------------------------------------------------------------- import.js:8:12 Cannot assign `'a'` to `w` because `"a"` [1] is incompatible with `T` [2]. [incompatible-type] import.js:8:12 8| var w: T = 'a'; // err ^^^ [1] References: import.js:8:8 8| var w: T = 'a'; // err ^ [2] Error ---------------------------------------------------------------------------------------------------- import.js:9:1 Cannot cast `y` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] import.js:9:1 9| y as empty; // err ^ References: export.js:4:15 4| export var x: number = 42; ^^^^^^ [1] import.js:9:6 9| y as empty; // err ^^^^^ [2] Error --------------------------------------------------------------------------------------------------- import.js:10:1 Cannot cast `X` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] import.js:10:1 10| X as empty; // err ^ References: export.js:6:16 6| export default 42; ^^ [1] import.js:10:6 10| X as empty; // err ^^^^^ [2] Error --------------------------------------------------------------------------------------------------- import.js:11:1 Cannot cast `Y.x` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] import.js:11:1 11| Y.x as empty; // err ^^^ References: export.js:4:15 4| export var x: number = 42; ^^^^^^ [1] import.js:11:8 11| Y.x as empty; // err ^^^^^ [2] Error ---------------------------------------------------------------------------------------------------- inter.js:20:1 Cannot cast `a.foo.w()` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] inter.js:20:1 20| a.foo.w() as empty; // err ^^^^^^^^^ References: inter.js:12:8 12| w(): number; ^^^^^^ [1] inter.js:20:14 20| a.foo.w() as empty; // err ^^^^^ [2] Error ---------------------------------------------------------------------------------------------------- inter.js:23:1 Cannot cast `c.m().w()` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] inter.js:23:1 23| c.m().w() as empty; // err ^^^^^^^^^ References: inter.js:12:8 12| w(): number; ^^^^^^ [1] inter.js:23:14 23| c.m().w() as empty; // err ^^^^^ [2] Error ---------------------------------------------------------------------------------------- member_assignments.js:8:3 Cannot cast `foo.bar` to `number` because `string` [1] is incompatible with `number` [2]. [incompatible-type] member_assignments.js:8:3 8| foo.bar as number; // error: string is incompatible with number ^^^^^^^ References: member_assignments.js:4:20 4| type Foo = {bar: string, ...}; ^^^^^^ [1] member_assignments.js:8:14 8| foo.bar as number; // error: string is incompatible with number ^^^^^^ [2] Error --------------------------------------------------------------------------------------- member_assignments.js:11:3 Cannot cast `foo.bar` to `number` because `""` [1] is incompatible with `number` [2]. [incompatible-type] member_assignments.js:11:3 11| foo.bar as number; // error: string is incompatible with number ^^^^^^^ References: member_assignments.js:9:13 9| foo.bar = ''; // ok ^^ [1] member_assignments.js:11:14 11| foo.bar as number; // error: string is incompatible with number ^^^^^^ [2] Error --------------------------------------------------------------------------------------- member_assignments.js:18:7 Cannot get `foo.bar` because property `bar` is not readable. [cannot-read] 18| foo.bar; // error: not readable ^^^ Error --------------------------------------------------------------------------------------- member_assignments.js:21:3 Cannot cast `foo.bar` to `number` because `""` [1] is incompatible with `number` [2]. [incompatible-type] member_assignments.js:21:3 21| foo.bar as number; // error: string is incompatible with number ^^^^^^^ References: member_assignments.js:19:13 19| foo.bar = ''; // ok ^^ [1] member_assignments.js:21:14 21| foo.bar as number; // error: string is incompatible with number ^^^^^^ [2] Error --------------------------------------------------------------------------------------- member_assignments.js:42:5 Cannot update `o.p` because property `p` is not writable. [cannot-write] 42| o.p += 2; // Error: property is non-writable ^ Error --------------------------------------------------------------------------------------- member_assignments.js:43:5 Cannot update `o.p` because property `p` is not writable. [cannot-write] 43| o.p -= 2; // Error: property is non-writable ^ Error --------------------------------------------------------------------------------------- member_assignments.js:44:5 Cannot update `o.p` because property `p` is not writable. [cannot-write] 44| o.p *= 2; // Error: property is non-writable ^ Error --------------------------------------------------------------------------------------- member_assignments.js:45:5 Cannot update `o.p` because property `p` is not writable. [cannot-write] 45| o.p /= 2; // Error: property is non-writable ^ Error --------------------------------------------------------------------------------------- member_assignments.js:46:5 Cannot update `o.p` because property `p` is not writable. [cannot-write] 46| o.p **= 2; // Error: property is non-writable ^ Error --------------------------------------------------------------------------------------- member_assignments.js:47:5 Cannot update `o.p` because property `p` is not writable. [cannot-write] 47| o.p %= 2; // Error: property is non-writable ^ Error --------------------------------------------------------------------------------------- member_assignments.js:48:5 Cannot update `o.p` because property `p` is not writable. [cannot-write] 48| o.p &&= 2; // Error: property is non-writable ^ Error --------------------------------------------------------------------------------------- member_assignments.js:49:5 Cannot update `o.p` because property `p` is not writable. [cannot-write] 49| o.p ||= 2; // Error: property is non-writable ^ Error --------------------------------------------------------------------------------------- member_assignments.js:50:5 Cannot update `o.p` because property `p` is not writable. [cannot-write] 50| o.p ??= 2; // Error: property is non-writable ^ Error -------------------------------------------------------------------------------------------------- tparams.js:3:26 Missing an annotation on this parameter. [missing-local-annot] 3| function remove(a: A, x): A { ^ Error --------------------------------------------------------------------------------------------------- tparams.js:4:3 Cannot cast `a` to `empty` because `unknown` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:4:3 4| a as empty; ^ References: tparams.js:3:23 3| function remove(a: A, x): A { ^ [1] tparams.js:4:8 4| a as empty; ^^^^^ [2] Error --------------------------------------------------------------------------------------------------- tparams.js:5:3 Cannot cast `42` to `A` because `42` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:5:3 5| 42 as A; ^^ [1] References: tparams.js:5:9 5| 42 as A; ^ [2] Error -------------------------------------------------------------------------------------------------- tparams.js:9:18 Cannot assign `remove<...>(...)` to `o` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:9:18 9| const o: empty = remove(1, 42); ^^^^^^^^^^^^^^^^^^^^^ References: tparams.js:9:25 9| const o: empty = remove(1, 42); ^^^^^^ [1] tparams.js:9:10 9| const o: empty = remove(1, 42); ^^^^^ [2] Error ------------------------------------------------------------------------------------------------- tparams.js:10:18 Cannot assign `remove(...)` to `p` because `1` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:10:18 10| const p: empty = remove(1, 42); ^^^^^^^^^^^^^ References: tparams.js:10:25 10| const p: empty = remove(1, 42); ^ [1] tparams.js:10:10 10| const p: empty = remove(1, 42); ^^^^^ [2] Error -------------------------------------------------------------------------------------------------- tparams.js:13:3 Cannot cast `a` to `empty` because `unknown` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:13:3 13| a as empty; ^ References: tparams.js:12:28 12| function remove_anno(a: A): A { ^ [1] tparams.js:13:8 13| a as empty; ^^^^^ [2] Error -------------------------------------------------------------------------------------------------- tparams.js:14:3 Cannot cast `42` to `A` because `42` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:14:3 14| 42 as A; ^^ [1] References: tparams.js:14:9 14| 42 as A; ^ [2] Error ------------------------------------------------------------------------------------------------- tparams.js:18:18 Cannot assign `remove_anno<...>(...)` to `q` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:18:18 18| const q: empty = remove_anno(1); ^^^^^^^^^^^^^^^^^^^^^^ References: tparams.js:18:30 18| const q: empty = remove_anno(1); ^^^^^^ [1] tparams.js:18:10 18| const q: empty = remove_anno(1); ^^^^^ [2] Error ------------------------------------------------------------------------------------------------- tparams.js:19:18 Cannot assign `remove_anno(...)` to `r` because `1` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:19:18 19| const r: empty = remove_anno(1); ^^^^^^^^^^^^^^ References: tparams.js:19:30 19| const r: empty = remove_anno(1); ^ [1] tparams.js:19:10 19| const r: empty = remove_anno(1); ^^^^^ [2] Error ------------------------------------------------------------------------------------------------- tparams.js:23:11 Cannot return array literal because in index `0`: inexact `{...}` [1] is incompatible with exact `{}` [2]. [incompatible-exact] tparams.js:23:11 23| return [o, p]; ^ References: tparams.js:22:16 22| const {p, ...o} = a; ^ [1] tparams.js:21:67 21| function removex(a: A): [Omit, B] { ^^^^^^^^^^^^ [2] Error ------------------------------------------------------------------------------------------------- tparams.js:23:14 Cannot return array literal because in index `1`: `unknown` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:23:14 23| return [o, p]; ^ References: tparams.js:21:41 21| function removex(a: A): [Omit, B] { ^^^^^^^ [1] tparams.js:21:81 21| function removex(a: A): [Omit, B] { ^ [2] Error ------------------------------------------------------------------------------------------------- tparams.js:45:18 Cannot resolve name `A`. [cannot-resolve-name] 45| m2() {} // Error: Cannot resolve name `A`. ^ Error ------------------------------------------------------------------------------------------------- tparams.js:48:40 Cannot cast `42` to `X` because `42` [1] is incompatible with `empty` [2]. [incompatible-type] tparams.js:48:40 48| function tparam_in_default(x: X = 42 as X) {} // Error: cannot cast 42 to X ^^ [1] References: tparams.js:48:46 48| function tparam_in_default(x: X = 42 as X) {} // Error: cannot cast 42 to X ^ [2] Error --------------------------------------------------------------------------------------------------- updates.js:5:1 Cannot cast `++x` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] updates.js:5:1 5| ++x as empty; // err ^^^ [1] References: updates.js:5:8 5| ++x as empty; // err ^^^^^ [2] Error --------------------------------------------------------------------------------------------------- updates.js:6:1 Cannot cast `x` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] updates.js:6:1 6| x as empty; // err ^ References: updates.js:5:1 5| ++x as empty; // err ^^^ [1] updates.js:6:6 6| x as empty; // err ^^^^^ [2] Error --------------------------------------------------------------------------------------------------- updates.js:8:1 Cannot cast `x` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] updates.js:8:1 8| x as empty; // err ^ References: updates.js:7:1 7| x += 42; ^^^^^^^ [1] updates.js:8:6 8| x as empty; // err ^^^^^ [2] Error -------------------------------------------------------------------------------------------------- updates.js:10:1 Cannot cast `x` to `empty` because `number` [1] is incompatible with `empty` [2]. [incompatible-type] updates.js:10:1 10| x as empty; // err ^ References: updates.js:9:1 9| x -= 42; ^^^^^^^ [1] updates.js:10:6 10| x as empty; // err ^^^^^ [2] Error -------------------------------------------------------------------------------------------------- updates.js:17:9 Cannot assign `3` to `x` because `3` [1] is incompatible with `boolean` [2]. [incompatible-type] updates.js:17:9 17| x &&= 3; // Error: number not assignable to boolean ^ [1] References: updates.js:14:10 14| let x: boolean = false; ^^^^^^^ [2] Error -------------------------------------------------------------------------------------------------- updates.js:18:9 Cannot assign `3` to `y` because `3` [1] is incompatible with `boolean` [2]. [incompatible-type] updates.js:18:9 18| y ||= 3; // Error: number not assignable to boolean ^ [1] References: updates.js:15:10 15| let y: boolean = false; ^^^^^^^ [2] Error -------------------------------------------------------------------------------------------------- updates.js:19:9 Cannot assign `3` to `z` because `3` [1] is incompatible with `boolean` [2]. [incompatible-type] updates.js:19:9 19| z ??= 3; // Error: number not assignable to boolean ^ [1] References: updates.js:16:11 16| let z: ?boolean = false; ^^^^^^^ [2] Error ------------------------------------------------------------------------------------------------- updates.js:39:29 Cannot expect `number` as the return type of function because `number` [1] is incompatible with `void` [1]. [incompatible-type] 39| function alwaysThrows1(): number { ^^^^^^ [1] Error ------------------------------------------------------------------------------------------------- updates.js:42:29 Cannot expect `number` as the return type of function because `number` [1] is incompatible with `void` [1]. [incompatible-type] 42| function alwaysThrows2(): number { ^^^^^^ [1] Error ------------------------------------------------------------------------------------------------- updates.js:45:29 Cannot expect `number` as the return type of function because `number` [1] is incompatible with `void` [1]. [incompatible-type] 45| function alwaysThrows3(): number { ^^^^^^ [1] Error -------------------------------------------------------------------------------------------------- updates.js:46:5 This condition is likely falsy. [WARNING]: Flow's type inference may be incorrect that it could be null at runtime (due to `any` annotations, out-of-bounds array accesses, etc.). If the check is valid, you might want to make [1] nullable (`T` -> `?T`). [constant-condition] updates.js:46:5 46| x ||= invariant(false); // constant-condition error ^ References: updates.js:36:10 36| let x: null = null; ^^^^ [1] Found 77 errors