From 88961cd164ff3c68383ebc1aad0b2c8f4b642b71 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 30 Oct 2016 18:09:07 -0700 Subject: [PATCH] Accept new baselines --- .../abstractPropertyNegative.errors.txt | 6 +- .../reference/assignToEnum.errors.txt | 12 +-- .../reference/assignments.errors.txt | 6 +- .../constDeclarations-access3.errors.txt | 102 +++++++++--------- .../constDeclarations-access4.errors.txt | 102 +++++++++--------- .../constDeclarations-access5.errors.txt | 102 +++++++++--------- .../constEnumPropertyAccess2.errors.txt | 6 +- .../decrementOperatorWithEnumType.errors.txt | 6 +- ...externalModuleImmutableBindings.errors.txt | 48 ++++----- .../importsImplicitlyReadonly.errors.txt | 12 +-- .../incrementOperatorWithEnumType.errors.txt | 12 +-- .../intersectionTypeReadonly.errors.txt | 30 +++--- .../invalidUndefinedAssignments.errors.txt | 6 +- .../readonlyConstructorAssignment.errors.txt | 6 +- ...readonlyInConstructorParameters.errors.txt | 6 +- .../reference/readonlyMembers.errors.txt | 78 +++++++------- .../reference/unionTypeReadonly.errors.txt | 24 ++--- .../reference/validNullAssignments.errors.txt | 6 +- 18 files changed, 285 insertions(+), 285 deletions(-) diff --git a/tests/baselines/reference/abstractPropertyNegative.errors.txt b/tests/baselines/reference/abstractPropertyNegative.errors.txt index 448fb2255e0..314ab842ded 100644 --- a/tests/baselines/reference/abstractPropertyNegative.errors.txt +++ b/tests/baselines/reference/abstractPropertyNegative.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/abstractPropertyNegative.ts(13,7): error TS2515: Non-abstra tests/cases/compiler/abstractPropertyNegative.ts(13,7): error TS2515: Non-abstract class 'C' does not implement inherited abstract member 'readonlyProp' from class 'B'. tests/cases/compiler/abstractPropertyNegative.ts(15,5): error TS1244: Abstract methods can only appear within an abstract class. tests/cases/compiler/abstractPropertyNegative.ts(16,37): error TS1005: '{' expected. -tests/cases/compiler/abstractPropertyNegative.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/abstractPropertyNegative.ts(19,3): error TS2540: Cannot assign to 'ro' because it is a constant or a read-only property. tests/cases/compiler/abstractPropertyNegative.ts(24,7): error TS2415: Class 'WrongTypePropertyImpl' incorrectly extends base class 'WrongTypeProperty'. Types of property 'num' are incompatible. Type 'string' is not assignable to type 'number'. @@ -58,8 +58,8 @@ tests/cases/compiler/abstractPropertyNegative.ts(41,18): error TS2676: Accessors } let c = new C(); c.ro = "error: lhs of assignment can't be readonly"; - ~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~ +!!! error TS2540: Cannot assign to 'ro' because it is a constant or a read-only property. abstract class WrongTypeProperty { abstract num: number; diff --git a/tests/baselines/reference/assignToEnum.errors.txt b/tests/baselines/reference/assignToEnum.errors.txt index c907db7a8bf..438a002ef1e 100644 --- a/tests/baselines/reference/assignToEnum.errors.txt +++ b/tests/baselines/reference/assignToEnum.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assignToEnum.ts(2,1): error TS2539: Cannot assign to 'A' because it is not a variable. tests/cases/compiler/assignToEnum.ts(3,1): error TS2539: Cannot assign to 'A' because it is not a variable. -tests/cases/compiler/assignToEnum.ts(4,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/assignToEnum.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/assignToEnum.ts(4,3): error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +tests/cases/compiler/assignToEnum.ts(5,3): error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. ==== tests/cases/compiler/assignToEnum.ts (4 errors) ==== @@ -13,10 +13,10 @@ tests/cases/compiler/assignToEnum.ts(5,1): error TS2450: Left-hand side of assig ~ !!! error TS2539: Cannot assign to 'A' because it is not a variable. A.foo = 1; // invalid LHS - ~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~ +!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. A.foo = A.bar; // invalid LHS - ~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~ +!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/assignments.errors.txt b/tests/baselines/reference/assignments.errors.txt index f99a4fc330d..86bbe75cd4b 100644 --- a/tests/baselines/reference/assignments.errors.txt +++ b/tests/baselines/reference/assignments.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(11,1): error TS2304: Cannot find name 'M'. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(14,1): error TS2539: Cannot assign to 'C' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(17,1): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(18,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(21,1): error TS2539: Cannot assign to 'fn' because it is not a variable. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): error TS2693: 'I' only refers to a type, but is being used as a value here. @@ -31,8 +31,8 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): er ~ !!! error TS2539: Cannot assign to 'E' because it is not a variable. E.A = null; // OK per spec, Error per implementation (509581) - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. function fn() { } fn = null; // Should be error diff --git a/tests/baselines/reference/constDeclarations-access3.errors.txt b/tests/baselines/reference/constDeclarations-access3.errors.txt index a6cb124d28c..43864d5274d 100644 --- a/tests/baselines/reference/constDeclarations-access3.errors.txt +++ b/tests/baselines/reference/constDeclarations-access3.errors.txt @@ -1,20 +1,20 @@ -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(8,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(9,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(10,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(11,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(12,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(13,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(14,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(15,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(16,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(17,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(18,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(19,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(21,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(22,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(23,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(24,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(26,7): error TS2540: Cannot assign to 'x' because it is 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. @@ -27,58 +27,58 @@ 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 or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x += 2; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x -= 3; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x *= 4; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x /= 5; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x %= 6; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x <<= 7; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x >>= 8; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x >>>= 9; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x &= 10; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x |= 11; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x ^= 12; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x++; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x--; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. ++M.x; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. --M.x; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. ++((M.x)); - ~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M["x"] = 0; ~~~~~~ diff --git a/tests/baselines/reference/constDeclarations-access4.errors.txt b/tests/baselines/reference/constDeclarations-access4.errors.txt index 3d7d4a704a8..d9b63941c76 100644 --- a/tests/baselines/reference/constDeclarations-access4.errors.txt +++ b/tests/baselines/reference/constDeclarations-access4.errors.txt @@ -1,20 +1,20 @@ -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(8,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(9,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(10,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(11,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(12,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(13,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(14,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(15,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(16,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(17,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(18,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(19,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(21,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(22,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(23,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(24,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(26,7): error TS2540: Cannot assign to 'x' because it is 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. @@ -27,58 +27,58 @@ 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 or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x += 2; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x -= 3; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x *= 4; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x /= 5; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x %= 6; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x <<= 7; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x >>= 8; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x >>>= 9; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x &= 10; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x |= 11; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x ^= 12; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x++; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M.x--; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. ++M.x; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. --M.x; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. ++((M.x)); - ~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. M["x"] = 0; ~~~~~~ diff --git a/tests/baselines/reference/constDeclarations-access5.errors.txt b/tests/baselines/reference/constDeclarations-access5.errors.txt index 45160bbc7ce..72f28b992a9 100644 --- a/tests/baselines/reference/constDeclarations-access5.errors.txt +++ b/tests/baselines/reference/constDeclarations-access5.errors.txt @@ -1,20 +1,20 @@ -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(4,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(5,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(6,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(7,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(8,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(9,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(10,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(11,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(12,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(13,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(14,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(15,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(17,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(18,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(19,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(20,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(22,7): error TS2540: Cannot assign to 'x' because it is 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. @@ -23,58 +23,58 @@ tests/cases/compiler/constDeclarations_access_2.ts(24,1): error TS2450: Left-han import m = require('constDeclarations_access_1'); // Errors m.x = 1; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x += 2; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x -= 3; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x *= 4; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x /= 5; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x %= 6; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x <<= 7; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x >>= 8; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x >>>= 9; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x &= 10; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x |= 11; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x ^= 12; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m m.x++; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m.x--; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. ++m.x; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. --m.x; - ~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. ++((m.x)); - ~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. m["x"] = 0; ~~~~~~ diff --git a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt index ef5dd331d32..9f16059ff2f 100644 --- a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt +++ b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(14,9): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(15,12): error TS2476: A const enum member can only be accessed using a string literal. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(17,1): error TS2322: Type '"string"' is not assignable to type 'G'. -tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,3): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. ==== tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts (4 errors) ==== @@ -30,6 +30,6 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,1): error TS24 !!! error TS2322: Type '"string"' is not assignable to type 'G'. function foo(x: G) { } G.B = 3; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt index 29e06bc6a4e..bad8dacd856 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(6,25): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,23): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(10,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'. @@ -15,8 +15,8 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp ~~~~~~~~~~ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. var ResultIsNumber2 = ENUM1.A--; - ~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. // miss assignment operator --ENUM1["A"]; diff --git a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt index c8c61b2dc81..7454868e361 100644 --- a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt +++ b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt @@ -1,21 +1,21 @@ -tests/cases/compiler/f2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/f2.ts(7,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. tests/cases/compiler/f2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. tests/cases/compiler/f2.ts(9,7): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(12,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/compiler/f2.ts(12,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. tests/cases/compiler/f2.ts(13,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. -tests/cases/compiler/f2.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/f2.ts(17,8): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. tests/cases/compiler/f2.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. tests/cases/compiler/f2.ts(19,8): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.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/f2.ts(22,8): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. tests/cases/compiler/f2.ts(23,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. -tests/cases/compiler/f2.ts(27,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(28,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property. +tests/cases/compiler/f2.ts(27,12): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/f2.ts(28,12): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. tests/cases/compiler/f2.ts(29,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. tests/cases/compiler/f2.ts(30,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property. tests/cases/compiler/f2.ts(31,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. tests/cases/compiler/f2.ts(32,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. -tests/cases/compiler/f2.ts(36,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. -tests/cases/compiler/f2.ts(37,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property. +tests/cases/compiler/f2.ts(36,13): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/f2.ts(37,13): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. tests/cases/compiler/f2.ts(38,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. tests/cases/compiler/f2.ts(39,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property. tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'. @@ -33,8 +33,8 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist var n = 'baz'; stuff.x = 0; - ~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. stuff['x'] = 1; ~~~~~~~~~~ !!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. @@ -44,8 +44,8 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist stuff[n] = 3; stuff.x++; - ~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. stuff['x']++; ~~~~~~~~~~ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. @@ -53,8 +53,8 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist stuff[n]++; (stuff.x) = 0; - ~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. (stuff['x']) = 1; ~~~~~~~~~~~~ !!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. @@ -64,8 +64,8 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist (stuff[n]) = 3; (stuff.x)++; - ~~~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. (stuff['x'])++; ~~~~~~~~~~~~ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. @@ -73,11 +73,11 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist (stuff[n])++; for (stuff.x in []) {} - ~~~~~~~ -!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. for (stuff.x of []) {} - ~~~~~~~ -!!! error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. for (stuff['x'] in []) {} ~~~~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. @@ -94,11 +94,11 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist for (stuff[n] of []) {} for ((stuff.x) in []) {} - ~~~~~~~~~ -!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. for ((stuff.x) of []) {} - ~~~~~~~~~ -!!! error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. for ((stuff['x']) in []) {} ~~~~~~~~~~~~ !!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'. diff --git a/tests/baselines/reference/importsImplicitlyReadonly.errors.txt b/tests/baselines/reference/importsImplicitlyReadonly.errors.txt index f0a781888fa..43596ffcea3 100644 --- a/tests/baselines/reference/importsImplicitlyReadonly.errors.txt +++ b/tests/baselines/reference/importsImplicitlyReadonly.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/externalModules/b.ts(6,1): error TS2539: Cannot assign to 'x' because it is not a variable. tests/cases/conformance/externalModules/b.ts(7,1): error TS2539: Cannot assign to 'y' because it is not a variable. -tests/cases/conformance/externalModules/b.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/conformance/externalModules/b.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/conformance/externalModules/b.ts(8,4): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/conformance/externalModules/b.ts(9,4): error TS2540: Cannot assign to 'y' because it is a constant or a read-only property. ==== tests/cases/conformance/externalModules/b.ts (4 errors) ==== @@ -17,11 +17,11 @@ tests/cases/conformance/externalModules/b.ts(9,1): error TS2450: Left-hand side ~ !!! error TS2539: Cannot assign to 'y' because it is not a variable. a1.x = 1; // Error - ~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. a1.y = 1; // Error - ~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'y' because it is a constant or a read-only property. a2.x = 1; a2.y = 1; a3.x = 1; diff --git a/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt index fc8b682b59e..5dc16bdc511 100644 --- a/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(6,25): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,23): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(10,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,7): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. ==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts (4 errors) ==== @@ -14,8 +14,8 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp ~~~~~~~~~~ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. var ResultIsNumber2 = ENUM1.B++; - ~~~~~~~ -!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. // miss assignment operator ++ENUM1["B"]; @@ -23,5 +23,5 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property. ENUM1.B++; - ~~~~~~~ -!!! 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 + ~ +!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/intersectionTypeReadonly.errors.txt b/tests/baselines/reference/intersectionTypeReadonly.errors.txt index d9e22fd2223..88ca9cb3b0c 100644 --- a/tests/baselines/reference/intersectionTypeReadonly.errors.txt +++ b/tests/baselines/reference/intersectionTypeReadonly.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(21,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(23,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(17,6): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,15): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. ==== tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts (5 errors) ==== @@ -23,22 +23,22 @@ tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,1): er } let base: Base; base.value = 12 // error, lhs can't be a readonly property - ~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~~~ +!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. let identical: Base & Identical; identical.value = 12; // error, lhs can't be a readonly property - ~~~~~~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~~~ +!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. let mutable: Base & Mutable; mutable.value = 12; // error, lhs can't be a readonly property - ~~~~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~~~ +!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. let differentType: Base & DifferentType; differentType.value = 12; // error, lhs can't be a readonly property - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~~~ +!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. let differentName: Base & DifferentName; differentName.value = 12; // error, property 'value' doesn't exist - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~~~ +!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt index 2f34bafd98f..b0a30f2dff3 100644 --- a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt +++ b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(4,1): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(5,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(9,1): error TS2539: Cannot assign to 'C' because it is not a variable. tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(14,1): error TS2693: 'I' only refers to a type, but is being used as a value here. tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(17,1): error TS2539: Cannot assign to 'M' because it is not a variable. @@ -14,8 +14,8 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.t ~ !!! error TS2539: Cannot assign to 'E' because it is not a variable. E.A = x; - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. class C { foo: string } var f: C; diff --git a/tests/baselines/reference/readonlyConstructorAssignment.errors.txt b/tests/baselines/reference/readonlyConstructorAssignment.errors.txt index e764fe21eda..31b4ad969cb 100644 --- a/tests/baselines/reference/readonlyConstructorAssignment.errors.txt +++ b/tests/baselines/reference/readonlyConstructorAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(13,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(13,14): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(33,7): error TS2415: Class 'E' incorrectly extends base class 'D'. Property 'x' is private in type 'D' but not in type 'E'. @@ -17,8 +17,8 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/re super(x); // Fails, x is readonly this.x = 1; - ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. } } diff --git a/tests/baselines/reference/readonlyInConstructorParameters.errors.txt b/tests/baselines/reference/readonlyInConstructorParameters.errors.txt index 6e4b549ce74..15d0d0be8eb 100644 --- a/tests/baselines/reference/readonlyInConstructorParameters.errors.txt +++ b/tests/baselines/reference/readonlyInConstructorParameters.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(4,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(4,10): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(7,26): error TS1029: 'public' modifier must precede 'readonly' modifier. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(13,10): error TS2341: Property 'x' is private and only accessible within class 'F'. @@ -8,8 +8,8 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/re constructor(readonly x: number) {} } new C(1).x = 2; - ~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. class E { constructor(readonly public x: number) {} diff --git a/tests/baselines/reference/readonlyMembers.errors.txt b/tests/baselines/reference/readonlyMembers.errors.txt index 7bc10aa3746..bea3a81bf7c 100644 --- a/tests/baselines/reference/readonlyMembers.errors.txt +++ b/tests/baselines/reference/readonlyMembers.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/readonlyMembers.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(17,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(19,13): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(20,13): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(21,13): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(25,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(26,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(27,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(36,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(40,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(49,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(56,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(7,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(8,3): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(17,14): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(19,18): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(20,18): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(21,18): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(25,14): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(26,14): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(27,14): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(36,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(40,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(49,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(56,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. tests/cases/compiler/readonlyMembers.ts(62,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. @@ -23,11 +23,11 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a } var x: X = { a: 0 }; x.a = 1; // Error - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. x.b = 1; // Error - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. class C { readonly a: number; @@ -37,30 +37,30 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a this.a = 1; // Ok this.b = 1; // Ok this.c = 1; // Error - ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. const f = () => { this.a = 1; // Error - ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. this.b = 1; // Error - ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. this.c = 1; // Error - ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. } } foo() { this.a = 1; // Error - ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. this.b = 1; // Error - ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. this.c = 1; // Error - ~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. } } @@ -70,14 +70,14 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a set b(value) { } }; o.a = 1; // Error - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. o.b = 1; var p: { readonly a: number, b: number } = { a: 1, b: 1 }; p.a = 1; // Error - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. p.b = 1; var q: { a: number, b: number } = p; q.a = 1; @@ -87,8 +87,8 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a A, B, C } E.A = 1; // Error - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. namespace N { export const a = 1; @@ -96,8 +96,8 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a export var c = 1; } N.a = 1; // Error - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. N.b = 1; N.c = 1; diff --git a/tests/baselines/reference/unionTypeReadonly.errors.txt b/tests/baselines/reference/unionTypeReadonly.errors.txt index ec660fc3a81..8248431a932 100644 --- a/tests/baselines/reference/unionTypeReadonly.errors.txt +++ b/tests/baselines/reference/unionTypeReadonly.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/types/union/unionTypeReadonly.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/conformance/types/union/unionTypeReadonly.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/conformance/types/union/unionTypeReadonly.ts(21,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. -tests/cases/conformance/types/union/unionTypeReadonly.ts(23,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(17,6): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. tests/cases/conformance/types/union/unionTypeReadonly.ts(25,15): error TS2339: Property 'value' does not exist on type 'Base | DifferentName'. Property 'value' does not exist on type 'DifferentName'. @@ -24,20 +24,20 @@ tests/cases/conformance/types/union/unionTypeReadonly.ts(25,15): error TS2339: P } let base: Base; base.value = 12 // error, lhs can't be a readonly property - ~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~~~ +!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. let identical: Base | Identical; identical.value = 12; // error, lhs can't be a readonly property - ~~~~~~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~~~ +!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. let mutable: Base | Mutable; mutable.value = 12; // error, lhs can't be a readonly property - ~~~~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~~~ +!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. let differentType: Base | DifferentType; differentType.value = 12; // error, lhs can't be a readonly property - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~~~~~ +!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. let differentName: Base | DifferentName; differentName.value = 12; // error, property 'value' doesn't exist ~~~~~ diff --git a/tests/baselines/reference/validNullAssignments.errors.txt b/tests/baselines/reference/validNullAssignments.errors.txt index 4ae9522d023..ae3b0695c9d 100644 --- a/tests/baselines/reference/validNullAssignments.errors.txt +++ b/tests/baselines/reference/validNullAssignments.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/primitives/null/validNullAssignments.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. +tests/cases/conformance/types/primitives/null/validNullAssignments.ts(10,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. tests/cases/conformance/types/primitives/null/validNullAssignments.ts(15,1): error TS2539: Cannot assign to 'C' because it is not a variable. tests/cases/conformance/types/primitives/null/validNullAssignments.ts(20,1): error TS2693: 'I' only refers to a type, but is being used as a value here. tests/cases/conformance/types/primitives/null/validNullAssignments.ts(23,1): error TS2539: Cannot assign to 'M' because it is not a variable. @@ -16,8 +16,8 @@ tests/cases/conformance/types/primitives/null/validNullAssignments.ts(30,1): err enum E { A } E.A = null; // error - ~~~ -!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property. + ~ +!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. class C { foo: string } var f: C;