diff --git a/tests/baselines/reference/abstractPropertyNegative.errors.txt b/tests/baselines/reference/abstractPropertyNegative.errors.txt index be1c85374fb..fd09b024213 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,3): error TS2540: Cannot assign to 'ro' because it is a constant or a read-only property. +tests/cases/compiler/abstractPropertyNegative.ts(19,3): error TS2540: Cannot assign to 'ro' because it is a read-only property. tests/cases/compiler/abstractPropertyNegative.ts(25,5): error TS2416: Property 'num' in type 'WrongTypePropertyImpl' is not assignable to the same property in base type 'WrongTypeProperty'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/abstractPropertyNegative.ts(31,9): error TS2416: Property 'num' in type 'WrongTypeAccessorImpl' is not assignable to the same property in base type 'WrongTypeAccessor'. @@ -56,7 +56,7 @@ 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 TS2540: Cannot assign to 'ro' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'ro' because it is 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 438a002ef1e..53b4afc1864 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,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,3): error TS2540: Cannot assign to 'foo' because it is a read-only property. +tests/cases/compiler/assignToEnum.ts(5,3): error TS2540: Cannot assign to 'foo' because it is a read-only property. ==== tests/cases/compiler/assignToEnum.ts (4 errors) ==== @@ -14,9 +14,9 @@ tests/cases/compiler/assignToEnum.ts(5,3): error TS2540: Cannot assign to 'foo' !!! error TS2539: Cannot assign to 'A' because it is not a variable. A.foo = 1; // invalid LHS ~~~ -!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'foo' because it is a read-only property. A.foo = A.bar; // invalid LHS ~~~ -!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'foo' because it is 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 cb8b7a17bdf..19cdbd813a6 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 TS2708: Cannot use namespace 'M' as a value. 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,3): error TS2540: Cannot assign to 'A' because it is 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 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. @@ -32,7 +32,7 @@ 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 TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. function fn() { } fn = null; // Should be error diff --git a/tests/baselines/reference/checkExportsObjectAssignProperty.errors.txt b/tests/baselines/reference/checkExportsObjectAssignProperty.errors.txt index 266c2180a68..cce3d89a761 100644 --- a/tests/baselines/reference/checkExportsObjectAssignProperty.errors.txt +++ b/tests/baselines/reference/checkExportsObjectAssignProperty.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/jsdoc/validator.ts(17,4): error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/validator.ts(18,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validator.ts(17,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. +tests/cases/conformance/jsdoc/validator.ts(18,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. tests/cases/conformance/jsdoc/validator.ts(19,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(20,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(21,1): error TS2322: Type '0' is not assignable to type 'string'. -tests/cases/conformance/jsdoc/validator.ts(37,4): error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/validator.ts(38,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validator.ts(37,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. +tests/cases/conformance/jsdoc/validator.ts(38,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. tests/cases/conformance/jsdoc/validator.ts(39,1): error TS2322: Type '0' is not assignable to type 'string'. tests/cases/conformance/jsdoc/validator.ts(40,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(41,1): error TS2322: Type '0' is not assignable to type 'string'. @@ -29,10 +29,10 @@ tests/cases/conformance/jsdoc/validator.ts(41,1): error TS2322: Type '0' is not // disallowed assignments m1.readonlyProp = "name"; ~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. m1.readonlyAccessor = 12; ~~~~~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. m1.thing = "no"; ~~~~~~~~ !!! error TS2322: Type '"no"' is not assignable to type 'number'. @@ -59,10 +59,10 @@ tests/cases/conformance/jsdoc/validator.ts(41,1): error TS2322: Type '0' is not // disallowed assignments m2.readonlyProp = "name"; ~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. m2.readonlyAccessor = 12; ~~~~~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. m2.thing = 0; ~~~~~~~~ !!! error TS2322: Type '0' is not assignable to type 'string'. diff --git a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.errors.txt b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.errors.txt index c2621a71b99..4d9ced85253 100644 --- a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.errors.txt +++ b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsdoc/validator.ts(19,4): error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/validator.ts(20,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validator.ts(19,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. +tests/cases/conformance/jsdoc/validator.ts(20,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. tests/cases/conformance/jsdoc/validator.ts(21,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(22,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(23,1): error TS2322: Type '0' is not assignable to type 'string'. @@ -26,10 +26,10 @@ tests/cases/conformance/jsdoc/validator.ts(23,1): error TS2322: Type '0' is not // disallowed assignments m1.readonlyProp = "name"; ~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. m1.readonlyAccessor = 12; ~~~~~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. m1.thing = "no"; ~~~~~~~~ !!! error TS2322: Type '"no"' is not assignable to type 'number'. diff --git a/tests/baselines/reference/checkObjectDefineProperty.errors.txt b/tests/baselines/reference/checkObjectDefineProperty.errors.txt index b587955ef2f..373b219d96c 100644 --- a/tests/baselines/reference/checkObjectDefineProperty.errors.txt +++ b/tests/baselines/reference/checkObjectDefineProperty.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsdoc/validate.ts(14,3): error TS2540: Cannot assign to 'lastName' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/validate.ts(15,3): error TS2540: Cannot assign to 'houseNumber' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validate.ts(14,3): error TS2540: Cannot assign to 'lastName' because it is a read-only property. +tests/cases/conformance/jsdoc/validate.ts(15,3): error TS2540: Cannot assign to 'houseNumber' because it is a read-only property. tests/cases/conformance/jsdoc/validate.ts(16,1): error TS2322: Type '12' is not assignable to type 'string'. -tests/cases/conformance/jsdoc/validate.ts(17,3): error TS2540: Cannot assign to 'middleInit' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validate.ts(17,3): error TS2540: Cannot assign to 'middleInit' because it is a read-only property. ==== tests/cases/conformance/jsdoc/validate.ts (4 errors) ==== @@ -20,16 +20,16 @@ tests/cases/conformance/jsdoc/validate.ts(17,3): error TS2540: Cannot assign to x.lastName = "should fail"; ~~~~~~~~ -!!! error TS2540: Cannot assign to 'lastName' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'lastName' because it is a read-only property. x.houseNumber = 12; // should also fail ~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'houseNumber' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'houseNumber' because it is a read-only property. x.zipStr = 12; // should fail ~~~~~~~~ !!! error TS2322: Type '12' is not assignable to type 'string'. x.middleInit = "R"; // should also fail ~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'middleInit' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'middleInit' because it is a read-only property. ==== tests/cases/conformance/jsdoc/index.js (0 errors) ==== const x = {}; diff --git a/tests/baselines/reference/checkOtherObjectAssignProperty.errors.txt b/tests/baselines/reference/checkOtherObjectAssignProperty.errors.txt index 146550d6fb6..eb7f066c0b1 100644 --- a/tests/baselines/reference/checkOtherObjectAssignProperty.errors.txt +++ b/tests/baselines/reference/checkOtherObjectAssignProperty.errors.txt @@ -2,9 +2,9 @@ tests/cases/conformance/jsdoc/importer.js(3,5): error TS2339: Property 'other' d tests/cases/conformance/jsdoc/importer.js(4,5): error TS2339: Property 'prop' does not exist on type 'typeof import("tests/cases/conformance/jsdoc/mod1")'. tests/cases/conformance/jsdoc/importer.js(11,5): error TS2339: Property 'other' does not exist on type 'typeof import("tests/cases/conformance/jsdoc/mod1")'. tests/cases/conformance/jsdoc/importer.js(12,5): error TS2339: Property 'prop' does not exist on type 'typeof import("tests/cases/conformance/jsdoc/mod1")'. -tests/cases/conformance/jsdoc/importer.js(13,5): error TS2540: Cannot assign to 'bad1' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/importer.js(14,5): error TS2540: Cannot assign to 'bad2' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/importer.js(15,5): error TS2540: Cannot assign to 'bad3' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/importer.js(13,5): error TS2540: Cannot assign to 'bad1' because it is a read-only property. +tests/cases/conformance/jsdoc/importer.js(14,5): error TS2540: Cannot assign to 'bad2' because it is a read-only property. +tests/cases/conformance/jsdoc/importer.js(15,5): error TS2540: Cannot assign to 'bad3' because it is a read-only property. ==== tests/cases/conformance/jsdoc/importer.js (7 errors) ==== @@ -30,13 +30,13 @@ tests/cases/conformance/jsdoc/importer.js(15,5): error TS2540: Cannot assign to !!! error TS2339: Property 'prop' does not exist on type 'typeof import("tests/cases/conformance/jsdoc/mod1")'. mod.bad1 = 0; ~~~~ -!!! error TS2540: Cannot assign to 'bad1' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'bad1' because it is a read-only property. mod.bad2 = 0; ~~~~ -!!! error TS2540: Cannot assign to 'bad2' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'bad2' because it is a read-only property. mod.bad3 = 0; ~~~~ -!!! error TS2540: Cannot assign to 'bad3' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'bad3' because it is a read-only property. ==== tests/cases/conformance/jsdoc/mod1.js (0 errors) ==== const obj = { value: 42, writable: true }; diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt index 4018e0866d6..8bf05c043ce 100644 --- a/tests/baselines/reference/conditionalTypes1.errors.txt +++ b/tests/baselines/reference/conditionalTypes1.errors.txt @@ -31,9 +31,9 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(116,5): error TS2 Type 'string' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. tests/cases/conformance/types/conditional/conditionalTypes1.ts(117,5): error TS2322: Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type 'keyof T' is not assignable to type 'never'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(134,10): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(134,10): error TS2540: Cannot assign to 'id' because it is a read-only property. tests/cases/conformance/types/conditional/conditionalTypes1.ts(135,5): error TS2542: Index signature in type 'DeepReadonlyArray' only permits reading. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(136,22): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(136,22): error TS2540: Cannot assign to 'id' because it is a read-only property. tests/cases/conformance/types/conditional/conditionalTypes1.ts(137,10): error TS2339: Property 'updatePart' does not exist on type 'DeepReadonlyObject'. tests/cases/conformance/types/conditional/conditionalTypes1.ts(159,5): error TS2322: Type 'ZeroOf' is not assignable to type 'T'. Type '0 | (T extends string ? "" : false)' is not assignable to type 'T'. @@ -231,13 +231,13 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS let id: number = part.subparts[0].id; part.id = part.id; // Error ~~ -!!! error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'id' because it is a read-only property. part.subparts[0] = part.subparts[0]; // Error ~~~~~~~~~~~~~~~~ !!! error TS2542: Index signature in type 'DeepReadonlyArray' only permits reading. part.subparts[0].id = part.subparts[0].id; // Error ~~ -!!! error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'id' because it is a read-only property. part.updatePart("hello"); // Error ~~~~~~~~~~ !!! error TS2339: Property 'updatePart' does not exist on type 'DeepReadonlyObject'. diff --git a/tests/baselines/reference/constDeclarations-access3.errors.txt b/tests/baselines/reference/constDeclarations-access3.errors.txt index dd55ef9166d..b6cada1c939 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(6,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(7,3): error TS2540: Cannot assign to 'x' because it is 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(19,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(20,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(21,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(22,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(24,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(6,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(7,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(8,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(9,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(10,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(11,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(12,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(13,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(14,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(15,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(16,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(17,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(19,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(20,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(21,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(22,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(24,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2540: Cannot assign to 'x' because it is a read-only property. ==== tests/cases/compiler/constDeclarations-access3.ts (18 errors) ==== @@ -26,61 +26,61 @@ tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2540: Cannot as // Errors M.x = 1; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x += 2; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x -= 3; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x *= 4; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x /= 5; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x %= 6; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x <<= 7; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x >>= 8; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x >>>= 9; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x &= 10; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x |= 11; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x ^= 12; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x--; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++M.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. --M.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++((M.x)); ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M["x"] = 0; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is 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 5bc4f1fadda..24ad11b2a3d 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(6,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(7,3): error TS2540: Cannot assign to 'x' because it is 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(19,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(20,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(21,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(22,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(24,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(6,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(7,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(8,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(9,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(10,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(11,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(12,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(13,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(14,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(15,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(16,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(17,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(19,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(20,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(21,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(22,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(24,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2540: Cannot assign to 'x' because it is a read-only property. ==== tests/cases/compiler/constDeclarations-access4.ts (18 errors) ==== @@ -26,61 +26,61 @@ tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2540: Cannot as // Errors M.x = 1; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x += 2; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x -= 3; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x *= 4; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x /= 5; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x %= 6; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x <<= 7; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x >>= 8; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x >>>= 9; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x &= 10; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x |= 11; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x ^= 12; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x--; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++M.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. --M.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++((M.x)); ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M["x"] = 0; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is 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 61d579dccc5..739a8fca1fc 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,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,3): error TS2540: Cannot assign to 'x' because it is 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 read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(5,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(6,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(7,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(8,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(9,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(10,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(11,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(12,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(13,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(14,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(15,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(17,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(18,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(19,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(20,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(22,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(24,3): error TS2540: Cannot assign to 'x' because it is 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,3): error TS2540: Cannot a // Errors m.x = 1; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x += 2; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x -= 3; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x *= 4; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x /= 5; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x %= 6; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x <<= 7; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x >>= 8; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x >>>= 9; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x &= 10; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x |= 11; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x ^= 12; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m m.x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x--; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++m.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. --m.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++((m.x)); ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m["x"] = 0; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. // OK var a = m.x + 1; diff --git a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt index 40731d3ad54..c80283f6536 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(13,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 or type query. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(14,12): error TS2476: A const enum member can only be accessed using a string literal. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(16,1): error TS2322: Type '"string"' is not assignable to type 'G'. -tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(18,3): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(18,3): error TS2540: Cannot assign to 'B' because it is a read-only property. ==== tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts (4 errors) ==== @@ -30,5 +30,5 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(18,3): error TS25 function foo(x: G) { } G.B = 3; ~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'B' because it is 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 284e15c5193..a0fc95c6fb0 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(6,31): error TS2540: Cannot assign to 'A' because it is 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,9): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(6,31): error TS2540: Cannot assign to 'A' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'A' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(10,9): error TS2540: Cannot assign to 'A' because it is 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,1): error TS2542: Index signature in type 'typeof ENUM1' only permits reading. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'. @@ -14,15 +14,15 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp // expression var ResultIsNumber1 = --ENUM1["A"]; ~~~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. var ResultIsNumber2 = ENUM1.A--; ~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. // miss assignment operator --ENUM1["A"]; ~~~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. ENUM1[A]--; ~~~~~~~~ diff --git a/tests/baselines/reference/enumMergeWithExpando.errors.txt b/tests/baselines/reference/enumMergeWithExpando.errors.txt index 7911206650c..586a25c69bf 100644 --- a/tests/baselines/reference/enumMergeWithExpando.errors.txt +++ b/tests/baselines/reference/enumMergeWithExpando.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/salsa/enums.js(2,10): error TS2540: Cannot assign to 'DESC' because it is a constant or a read-only property. -tests/cases/conformance/salsa/enums.js(3,10): error TS2540: Cannot assign to 'ASC' because it is a constant or a read-only property. +tests/cases/conformance/salsa/enums.js(2,10): error TS2540: Cannot assign to 'DESC' because it is a read-only property. +tests/cases/conformance/salsa/enums.js(3,10): error TS2540: Cannot assign to 'ASC' because it is a read-only property. ==== tests/cases/conformance/salsa/lovefield-ts.d.ts (0 errors) ==== @@ -12,8 +12,8 @@ tests/cases/conformance/salsa/enums.js(3,10): error TS2540: Cannot assign to 'AS lf.Order = {} lf.Order.DESC = 0; ~~~~ -!!! error TS2540: Cannot assign to 'DESC' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'DESC' because it is a read-only property. lf.Order.ASC = 1; ~~~ -!!! error TS2540: Cannot assign to 'ASC' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'ASC' because it is a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt index d6a2be707e0..832ce01f751 100644 --- a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt +++ b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/f2.ts(6,7): error TS2540: Cannot assign to 'x' because it is 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(6,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(7,7): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/compiler/f2.ts(8,7): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. -tests/cases/compiler/f2.ts(11,7): error TS2540: Cannot assign to 'x' because it is 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(16,8): error TS2540: Cannot assign to 'x' because it is 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(11,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(12,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(16,8): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(17,8): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/compiler/f2.ts(18,8): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. -tests/cases/compiler/f2.ts(21,8): error TS2540: Cannot assign to 'x' because it is 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(26,12): error TS2540: Cannot assign to 'x' because it is 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,12): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/f2.ts(21,8): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(22,8): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(26,12): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(27,12): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(28,12): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(29,12): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/compiler/f2.ts(30,12): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. tests/cases/compiler/f2.ts(31,12): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. -tests/cases/compiler/f2.ts(35,13): error TS2540: Cannot assign to 'x' because it is 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,13): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/f2.ts(35,13): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(36,13): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(37,13): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(38,13): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/compiler/f2.ts(39,13): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. @@ -33,10 +33,10 @@ tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist stuff.x = 0; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. stuff['x'] = 1; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. stuff.blah = 2; ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. @@ -44,19 +44,19 @@ tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist stuff.x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. stuff['x']++; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. stuff['blah']++; stuff[n]++; (stuff.x) = 0; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. (stuff['x']) = 1; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. (stuff.blah) = 2; ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. @@ -64,25 +64,25 @@ tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist (stuff.x)++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. (stuff['x'])++; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. (stuff['blah'])++; (stuff[n])++; for (stuff.x in []) {} ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for (stuff.x of []) {} ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for (stuff['x'] in []) {} ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for (stuff['x'] of []) {} ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for (stuff.blah in []) {} ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. @@ -94,16 +94,16 @@ tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist for ((stuff.x) in []) {} ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for ((stuff.x) of []) {} ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for ((stuff['x']) in []) {} ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for ((stuff['x']) of []) {} ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for ((stuff.blah) in []) {} ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. diff --git a/tests/baselines/reference/importsImplicitlyReadonly.errors.txt b/tests/baselines/reference/importsImplicitlyReadonly.errors.txt index aad8480a77a..f760e08f36a 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,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(8,4): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/conformance/externalModules/b.ts(9,4): error TS2540: Cannot assign to 'y' because it is a read-only property. ==== tests/cases/conformance/externalModules/b.ts (4 errors) ==== @@ -18,10 +18,10 @@ tests/cases/conformance/externalModules/b.ts(9,4): error TS2540: Cannot assign t !!! error TS2539: Cannot assign to 'y' because it is not a variable. a1.x = 1; // Error ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. a1.y = 1; // Error ~ -!!! error TS2540: Cannot assign to 'y' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'y' because it is 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 8fdbc343562..eb1d0955a92 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,31): error TS2540: Cannot assign to 'B' because it is 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,9): error TS2540: Cannot assign to 'B' because it is 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(6,31): error TS2540: Cannot assign to 'B' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'B' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(10,9): error TS2540: Cannot assign to 'B' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,7): error TS2540: Cannot assign to 'B' because it is a read-only property. ==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts (4 errors) ==== @@ -12,16 +12,16 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp // expression var ResultIsNumber1 = ++ENUM1["B"]; ~~~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'B' because it is a read-only property. var ResultIsNumber2 = ENUM1.B++; ~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'B' because it is a read-only property. // miss assignment operator ++ENUM1["B"]; ~~~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'B' because it is a read-only property. ENUM1.B++; ~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. \ No newline at end of file +!!! error TS2540: Cannot assign to 'B' because it is 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 88ca9cb3b0c..6aed59d9d91 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,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(17,6): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,15): error TS2540: Cannot assign to 'value' because it is a read-only property. ==== tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts (5 errors) ==== @@ -24,21 +24,21 @@ tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,15): e let base: Base; base.value = 12 // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let identical: Base & Identical; identical.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let mutable: Base & Mutable; mutable.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let differentType: Base & DifferentType; differentType.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let differentName: Base & DifferentName; differentName.value = 12; // error, property 'value' doesn't exist ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is 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 b0a30f2dff3..223835f2027 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,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(5,3): error TS2540: Cannot assign to 'A' because it is 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. @@ -15,7 +15,7 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.t !!! error TS2539: Cannot assign to 'E' because it is not a variable. E.A = x; ~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. class C { foo: string } var f: C; diff --git a/tests/baselines/reference/mappedTypes6.errors.txt b/tests/baselines/reference/mappedTypes6.errors.txt index 843a59eecb5..f053ae313c5 100644 --- a/tests/baselines/reference/mappedTypes6.errors.txt +++ b/tests/baselines/reference/mappedTypes6.errors.txt @@ -19,9 +19,9 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(105,1): error TS2322: Type Property 'c' is missing in type '{ a: number; b: number; }'. tests/cases/conformance/types/mapped/mappedTypes6.ts(106,1): error TS2322: Type '{ a: number; b: number; c: number; }' is not assignable to type 'Required'. Property 'd' is missing in type '{ a: number; b: number; c: number; }'. -tests/cases/conformance/types/mapped/mappedTypes6.ts(116,4): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -tests/cases/conformance/types/mapped/mappedTypes6.ts(119,4): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(116,4): error TS2540: Cannot assign to 'b' because it is a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(119,4): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Cannot assign to 'b' because it is a read-only property. ==== tests/cases/conformance/types/mapped/mappedTypes6.ts (19 errors) ==== @@ -179,15 +179,15 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Canno x3.a = 1; x3.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. declare let x4: Readonly; x4.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. x4.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. declare let x5: Readwrite; x5.a = 1; diff --git a/tests/baselines/reference/objectFreeze.errors.txt b/tests/baselines/reference/objectFreeze.errors.txt index 48f41143d61..f89ef42f4c7 100644 --- a/tests/baselines/reference/objectFreeze.errors.txt +++ b/tests/baselines/reference/objectFreeze.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/objectFreeze.ts(9,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/objectFreeze.ts(9,1): error TS2542: Index signature in type 'ReadonlyArray' only permits reading. -tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' because it is a read-only property. ==== tests/cases/compiler/objectFreeze.ts (3 errors) ==== @@ -21,5 +21,5 @@ tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' b const o = Object.freeze({ a: 1, b: "string" }); o.b = o.a.toString(); ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt index e878d0fd54f..6ce02e5e232 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt @@ -1,5 +1,5 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type '"10"' is not assignable to type 'number'. -maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it is a constant or a read-only property. +maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it is a read-only property. ==== maxDepthExceeded/tsconfig.json (0 errors) ==== @@ -36,7 +36,7 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i !!! error TS2322: Type '"10"' is not assignable to type 'number'. m1.rel = 42; // Error: Should be boolean ~~~ -!!! error TS2540: Cannot assign to 'rel' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'rel' because it is a read-only property. m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt index e878d0fd54f..6ce02e5e232 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt @@ -1,5 +1,5 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type '"10"' is not assignable to type 'number'. -maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it is a constant or a read-only property. +maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it is a read-only property. ==== maxDepthExceeded/tsconfig.json (0 errors) ==== @@ -36,7 +36,7 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i !!! error TS2322: Type '"10"' is not assignable to type 'number'. m1.rel = 42; // Error: Should be boolean ~~~ -!!! error TS2540: Cannot assign to 'rel' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'rel' because it is a read-only property. m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". diff --git a/tests/baselines/reference/readonlyAssignmentInSubclassOfClassExpression.errors.txt b/tests/baselines/reference/readonlyAssignmentInSubclassOfClassExpression.errors.txt index 760cee54025..ceae2b62d6c 100644 --- a/tests/baselines/reference/readonlyAssignmentInSubclassOfClassExpression.errors.txt +++ b/tests/baselines/reference/readonlyAssignmentInSubclassOfClassExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/readonlyAssignmentInSubclassOfClassExpression.ts(4,14): error TS2540: Cannot assign to 'attrib' because it is a constant or a read-only property. +tests/cases/compiler/readonlyAssignmentInSubclassOfClassExpression.ts(4,14): error TS2540: Cannot assign to 'attrib' because it is a read-only property. ==== tests/cases/compiler/readonlyAssignmentInSubclassOfClassExpression.ts (1 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/readonlyAssignmentInSubclassOfClassExpression.ts(4,14): err super() this.attrib = 2 ~~~~~~ -!!! error TS2540: Cannot assign to 'attrib' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'attrib' because it is a read-only property. } } \ No newline at end of file diff --git a/tests/baselines/reference/readonlyConstructorAssignment.errors.txt b/tests/baselines/reference/readonlyConstructorAssignment.errors.txt index 31b4ad969cb..ecd22168d72 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,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(13,14): error TS2540: Cannot assign to 'x' because it is 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'. @@ -18,7 +18,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/re // Fails, x is readonly this.x = 1; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. } } diff --git a/tests/baselines/reference/readonlyInConstructorParameters.errors.txt b/tests/baselines/reference/readonlyInConstructorParameters.errors.txt index 15d0d0be8eb..4737812728a 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,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(4,10): error TS2540: Cannot assign to 'x' because it is 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'. @@ -9,7 +9,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/re } new C(1).x = 2; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is 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 9baf37f27e7..bea7932ed4c 100644 --- a/tests/baselines/reference/readonlyMembers.errors.txt +++ b/tests/baselines/reference/readonlyMembers.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/readonlyMembers.ts(6,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(7,3): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(16,14): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(18,18): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(19,18): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(20,18): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(24,14): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(25,14): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(26,14): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(35,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(39,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(48,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(55,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(6,3): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(7,3): error TS2540: Cannot assign to 'b' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(16,14): error TS2540: Cannot assign to 'c' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(18,18): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(19,18): error TS2540: Cannot assign to 'b' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(20,18): error TS2540: Cannot assign to 'c' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(24,14): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(25,14): error TS2540: Cannot assign to 'b' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(26,14): error TS2540: Cannot assign to 'c' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(35,3): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(39,3): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(48,3): error TS2540: Cannot assign to 'A' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(55,3): error TS2540: Cannot assign to 'a' because it is a read-only property. tests/cases/compiler/readonlyMembers.ts(61,1): error TS2542: Index signature in type '{ readonly [x: string]: string; }' only permits reading. tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in type '{ [x: string]: string; readonly [x: number]: string; }' only permits reading. @@ -23,10 +23,10 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in var x: X = { a: 0 }; x.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. x.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. class C { readonly a: number; @@ -37,29 +37,29 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in this.b = 1; // Ok this.c = 1; // Error ~ -!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'c' because it is a read-only property. const f = () => { this.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. this.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. this.c = 1; // Error ~ -!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'c' because it is a read-only property. } } foo() { this.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. this.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. this.c = 1; // Error ~ -!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'c' because it is a read-only property. } } @@ -70,13 +70,13 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in }; o.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. o.b = 1; var p: { readonly a: number, b: number } = { a: 1, b: 1 }; p.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. p.b = 1; var q: { a: number, b: number } = p; q.a = 1; @@ -87,7 +87,7 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in } E.A = 1; // Error ~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. namespace N { export const a = 1; @@ -96,7 +96,7 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in } N.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is 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 8248431a932..0d11c63d17f 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,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(17,6): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is 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'. @@ -25,19 +25,19 @@ 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 TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let identical: Base | Identical; identical.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let mutable: Base | Mutable; mutable.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let differentType: Base | DifferentType; differentType.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let differentName: Base | DifferentName; differentName.value = 12; // error, property 'value' doesn't exist ~~~~~ diff --git a/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt b/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt index e95a184d15a..fb4463bc2d9 100644 --- a/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt +++ b/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(11,3): error TS2339: Property 'bar' does not exist on type 'Missing'. Property 'bar' does not exist on type '{ [s: string]: string; }'. -tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(14,4): error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(14,4): error TS2540: Cannot assign to 'foo' because it is a read-only property. tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(24,1): error TS7017: Element implicitly has an 'any' type because type 'Both' has no index signature. tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(25,1): error TS2322: Type '"not ok"' is not assignable to type 'number'. tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(26,1): error TS7017: Element implicitly has an 'any' type because type 'Both' has no index signature. @@ -25,7 +25,7 @@ tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(26,1): error declare var ro: RO ro.foo = 'not allowed' ~~~ -!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'foo' because it is a read-only property. type Num = { '0': string } | { [n: number]: number } declare var num: Num num[0] = 1 diff --git a/tests/baselines/reference/validNullAssignments.errors.txt b/tests/baselines/reference/validNullAssignments.errors.txt index ae3b0695c9d..e3dd21599b5 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,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(10,3): error TS2540: Cannot assign to 'A' because it is 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. @@ -17,7 +17,7 @@ tests/cases/conformance/types/primitives/null/validNullAssignments.ts(30,1): err enum E { A } E.A = null; // error ~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. class C { foo: string } var f: C;