diff --git a/tests/baselines/reference/constDeclarations-access.errors.txt b/tests/baselines/reference/constDeclarations-access.errors.txt index 04b942aec09..3c748cc4a5f 100644 --- a/tests/baselines/reference/constDeclarations-access.errors.txt +++ b/tests/baselines/reference/constDeclarations-access.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/file2.ts(1,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/file2.ts(1,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ==== tests/cases/compiler/file1.ts (0 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/file2.ts(1,1): error TS2449: The operand of an increment or ==== tests/cases/compiler/file2.ts (1 errors) ==== x++; ~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. \ No newline at end of file +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-access2.errors.txt b/tests/baselines/reference/constDeclarations-access2.errors.txt index 6a360e11014..667f490a374 100644 --- a/tests/baselines/reference/constDeclarations-access2.errors.txt +++ b/tests/baselines/reference/constDeclarations-access2.errors.txt @@ -1,20 +1,20 @@ -tests/cases/compiler/constDeclarations-access2.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(6,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(18,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(19,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(20,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(21,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access2.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-access2.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(6,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(18,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(19,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(20,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(21,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ==== tests/cases/compiler/constDeclarations-access2.ts (17 errors) ==== @@ -24,57 +24,57 @@ tests/cases/compiler/constDeclarations-access2.ts(23,3): error TS2449: The opera // Errors x = 1; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x += 2; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x -= 3; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x *= 4; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x /= 5; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x %= 6; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x <<= 7; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x >>= 8; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x >>>= 9; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x &= 10; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x |= 11; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x ^= 12; ~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. x++; ~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. x--; ~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ++x; ~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. --x; ~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ++((x)); ~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. // OK var a = x + 1; diff --git a/tests/baselines/reference/constDeclarations-access3.errors.txt b/tests/baselines/reference/constDeclarations-access3.errors.txt index 577b087dff0..a6cb124d28c 100644 --- a/tests/baselines/reference/constDeclarations-access3.errors.txt +++ b/tests/baselines/reference/constDeclarations-access3.errors.txt @@ -1,21 +1,21 @@ -tests/cases/compiler/constDeclarations-access3.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(21,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(22,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(24,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access3.ts(28,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access3.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(21,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(22,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(24,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(28,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. ==== tests/cases/compiler/constDeclarations-access3.ts (18 errors) ==== @@ -28,61 +28,61 @@ tests/cases/compiler/constDeclarations-access3.ts(28,1): error TS2450: Left-hand // Errors M.x = 1; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x += 2; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x -= 3; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x *= 4; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x /= 5; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x %= 6; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x <<= 7; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x >>= 8; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x >>>= 9; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x &= 10; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x |= 11; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x ^= 12; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x++; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. M.x--; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ++M.x; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. --M.x; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ++((M.x)); ~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. M["x"] = 0; ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. // OK var a = M.x + 1; diff --git a/tests/baselines/reference/constDeclarations-access4.errors.txt b/tests/baselines/reference/constDeclarations-access4.errors.txt index 9745c0d2624..3d7d4a704a8 100644 --- a/tests/baselines/reference/constDeclarations-access4.errors.txt +++ b/tests/baselines/reference/constDeclarations-access4.errors.txt @@ -1,21 +1,21 @@ -tests/cases/compiler/constDeclarations-access4.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(21,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(22,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(24,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations-access4.ts(28,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations-access4.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(21,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(22,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(24,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(28,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. ==== tests/cases/compiler/constDeclarations-access4.ts (18 errors) ==== @@ -28,61 +28,61 @@ tests/cases/compiler/constDeclarations-access4.ts(28,1): error TS2450: Left-hand // Errors M.x = 1; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x += 2; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x -= 3; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x *= 4; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x /= 5; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x %= 6; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x <<= 7; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x >>= 8; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x >>>= 9; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x &= 10; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x |= 11; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x ^= 12; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. M.x++; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. M.x--; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ++M.x; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. --M.x; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ++((M.x)); ~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. M["x"] = 0; ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. // OK var a = M.x + 1; diff --git a/tests/baselines/reference/constDeclarations-access5.errors.txt b/tests/baselines/reference/constDeclarations-access5.errors.txt index 23200e50ee4..45160bbc7ce 100644 --- a/tests/baselines/reference/constDeclarations-access5.errors.txt +++ b/tests/baselines/reference/constDeclarations-access5.errors.txt @@ -1,21 +1,21 @@ -tests/cases/compiler/constDeclarations_access_2.ts(4,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(6,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(17,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(18,1): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(19,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(20,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(22,3): error TS2449: The operand of an increment or decrement operator cannot be a constant. -tests/cases/compiler/constDeclarations_access_2.ts(24,1): error TS2450: Left-hand side of assignment expression cannot be a constant. +tests/cases/compiler/constDeclarations_access_2.ts(4,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(6,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(17,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(18,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(19,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(20,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(22,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(24,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. ==== tests/cases/compiler/constDeclarations_access_2.ts (18 errors) ==== @@ -24,61 +24,61 @@ tests/cases/compiler/constDeclarations_access_2.ts(24,1): error TS2450: Left-han // Errors m.x = 1; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x += 2; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x -= 3; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x *= 4; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x /= 5; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x %= 6; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x <<= 7; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x >>= 8; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x >>>= 9; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x &= 10; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x |= 11; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m.x ^= 12; ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. m m.x++; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. m.x--; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ++m.x; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. --m.x; ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ++((m.x)); ~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. m["x"] = 0; ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant. +!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. // OK var a = m.x + 1; diff --git a/tests/baselines/reference/constDeclarations-errors.errors.txt b/tests/baselines/reference/constDeclarations-errors.errors.txt index 10501beb1a5..98b12b616f7 100644 --- a/tests/baselines/reference/constDeclarations-errors.errors.txt +++ b/tests/baselines/reference/constDeclarations-errors.errors.txt @@ -4,7 +4,7 @@ tests/cases/compiler/constDeclarations-errors.ts(5,7): error TS1155: 'const' dec tests/cases/compiler/constDeclarations-errors.ts(5,11): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(5,15): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(5,27): error TS1155: 'const' declarations must be initialized -tests/cases/compiler/constDeclarations-errors.ts(10,27): error TS2449: The operand of an increment or decrement operator cannot be a constant. +tests/cases/compiler/constDeclarations-errors.ts(10,27): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. tests/cases/compiler/constDeclarations-errors.ts(13,11): error TS1155: 'const' declarations must be initialized tests/cases/compiler/constDeclarations-errors.ts(16,20): error TS1155: 'const' declarations must be initialized @@ -33,7 +33,7 @@ tests/cases/compiler/constDeclarations-errors.ts(16,20): error TS1155: 'const' d // error, assigning to a const for(const c8 = 0; c8 < 1; c8++) { } ~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant. +!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. // error, can not be unintalized for(const c9; c9 < 1;) { } diff --git a/tests/baselines/reference/for-of2.errors.txt b/tests/baselines/reference/for-of2.errors.txt index 0b5133cde13..f4f39f60f67 100644 --- a/tests/baselines/reference/for-of2.errors.txt +++ b/tests/baselines/reference/for-of2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/for-ofStatements/for-of2.ts(1,7): error TS1155: 'const' declarations must be initialized -tests/cases/conformance/es6/for-ofStatements/for-of2.ts(2,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a previously defined constant. +tests/cases/conformance/es6/for-ofStatements/for-of2.ts(2,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property. ==== tests/cases/conformance/es6/for-ofStatements/for-of2.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/es6/for-ofStatements/for-of2.ts(2,6): error TS2485: The !!! error TS1155: 'const' declarations must be initialized for (v of []) { } ~ -!!! error TS2485: The left-hand side of a 'for...of' statement cannot be a previously defined constant. \ No newline at end of file +!!! error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property. \ No newline at end of file