Error ---------------------------------------------------------------------------------------------------- unary.js:8:11 Cannot perform arithmetic operation because `string` [1] is not a number or bigint. [unsafe-arithmetic] unary.js:8:11 8| return -y; // error, we don't allow coercion here ^ References: unary.js:7:16 7| function x1(y: string): number { ^^^^^^ [1] Error --------------------------------------------------------------------------------------------------- unary.js:12:11 Cannot perform arithmetic operation because `string` [1] is not a number or bigint. [unsafe-arithmetic] unary.js:12:11 12| return ~y; // error, we don't allow coercion here ^ References: unary.js:11:16 11| function x3(y: string) { ^^^^^^ [1] Error ---------------------------------------------------------------------------------------------------- unary.js:19:1 Cannot cast `-1` to `void` because `-1` [1] is incompatible with `void` [2]. [incompatible-type] unary.js:19:1 19| -1 as void; // error, number ~> void ^^ [1] References: unary.js:19:7 19| -1 as void; // error, number ~> void ^^^^ [2] Error --------------------------------------------------------------------------------------------------- unary.js:28:10 Cannot return `!a` because `true` [1] is incompatible with `false` [2]. [incompatible-type] unary.js:28:10 28| return !a; // error, true ~> false ^^ [1] References: unary.js:27:27 27| function x6(a: A): false { ^^^^^ [2] Error --------------------------------------------------------------------------------------------------- unary.js:36:10 Cannot return `!a` because `true` [1] is incompatible with `false` [2]. [incompatible-type] unary.js:36:10 36| return !a; // error, true ~> false ^^ [1] References: unary.js:35:32 35| function x8(a: false & false): false { ^^^^^ [2] Error --------------------------------------------------------------------------------------------------- unary.js:64:11 Cannot perform unary plus because a `bigint` [1] cannot be coerced to number. [bigint-num-coerce] unary.js:64:11 64| return +y; // error, bigint cannot be coerced to number ^ References: unary.js:63:17 63| function x15(y: bigint) { ^^^^^^ [1] Error ---------------------------------------------------------------------------------------------------- unary.js:73:3 Cannot cast `+y` to `bigint` because `number` [1] is incompatible with `bigint` [2]. [incompatible-type] unary.js:73:3 73| +y as bigint; // error, bigint ~> number ^^ [1] References: unary.js:73:9 73| +y as bigint; // error, bigint ~> number ^^^^^^ [2] Error ---------------------------------------------------------------------------------------------------- unary.js:78:3 Cannot cast `+y` to `bigint` because `number` [1] is incompatible with `bigint` [2]. [incompatible-type] unary.js:78:3 78| +y as bigint; // error, bigint ~> number ^^ [1] References: unary.js:78:9 78| +y as bigint; // error, bigint ~> number ^^^^^^ [2] Error --------------------------------------------------------------------------------------------------- update.js:10:5 Cannot perform arithmetic operation because `string` [1] is not a number or bigint. [unsafe-arithmetic] update.js:10:5 10| y++; // error, we don't allow coercion here ^ References: update.js:9:15 9| function(y: string) { ^^^^^^ [1] Error --------------------------------------------------------------------------------------------------- update.js:16:5 Cannot perform arithmetic operation because `string` [1] is not a number or bigint. [unsafe-arithmetic] update.js:16:5 16| y--; // error, we don't allow coercion here ^ References: update.js:15:15 15| function(y: string) { ^^^^^^ [1] Error --------------------------------------------------------------------------------------------------- update.js:20:7 Cannot perform arithmetic operation because `string` [1] is not a number or bigint. [unsafe-arithmetic] update.js:20:7 20| ++y; // error, we don't allow coercion here ^ References: update.js:19:15 19| function(y: string) { ^^^^^^ [1] Error --------------------------------------------------------------------------------------------------- update.js:24:7 Cannot perform arithmetic operation because `string` [1] is not a number or bigint. [unsafe-arithmetic] update.js:24:7 24| --y; // error, we don't allow coercion here ^ References: update.js:23:15 23| function(y: string) { ^^^^^^ [1] Error --------------------------------------------------------------------------------------------------- update.js:29:5 Cannot reassign constant `y` [1]. [reassign-const] update.js:29:5 29| y++; // error, can't update const ^ References: update.js:28:11 28| const y = 123; ^ [1] Error --------------------------------------------------------------------------------------------------- update.js:30:5 Cannot reassign constant `y` [1]. [reassign-const] update.js:30:5 30| y--; // error, can't update const ^ References: update.js:28:11 28| const y = 123; ^ [1] Error --------------------------------------------------------------------------------------------------- update.js:34:7 Cannot update `o.y` because property `y` is not writable. [cannot-write] 34| o.y++; // error, can't update read-only property ^ Error --------------------------------------------------------------------------------------------------- update.js:35:7 Cannot update `o.y` because property `y` is not writable. [cannot-write] 35| o.y--; // error, can't update read-only property ^ Error --------------------------------------------------------------------------------------------------- update.js:39:7 Cannot get `o.y` because property `y` is not readable. [cannot-read] 39| o.y++; // error, can't read write-only property ^ Error --------------------------------------------------------------------------------------------------- update.js:45:5 Cannot update `xs[0]` because read-only arrays cannot be written to. [cannot-write] 45| xs[0]++; ^^^^^ Error --------------------------------------------------------------------------------------------------- update.js:46:5 Cannot update `xs[0]` because read-only arrays cannot be written to. [cannot-write] 46| xs[0]--; ^^^^^ Error --------------------------------------------------------------------------------------------------- update.js:71:5 Cannot cast `a.x` to `1` because `number` [1] is incompatible with `1` [2]. [incompatible-type] update.js:71:5 71| a.x as 1; // error: `a` and `o` are the same object ^^^ References: update.js:67:16 67| const o: {x: number} = {x: 1}; ^^^^^^ [1] update.js:71:12 71| a.x as 1; // error: `a` and `o` are the same object ^ [2] Error --------------------------------------------------------------------------------------------------- update.js:80:5 Cannot cast `a.x` to `1` because `number` [1] is incompatible with `1` [2]. [incompatible-type] update.js:80:5 80| a.x as 1; // error ^^^ References: update.js:76:16 76| const o: {x: number, y: number} = {x: 1, y: 7}; ^^^^^^ [1] update.js:80:12 80| a.x as 1; // error ^ [2] Found 21 errors