accept baseline for changed error message #2540

This commit is contained in:
Alexander
2018-11-03 16:10:56 +02:00
parent ae8d54658a
commit 66539b4378
30 changed files with 268 additions and 268 deletions

View File

@@ -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;

View File

@@ -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.

View File

@@ -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

View File

@@ -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'.

View File

@@ -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'.

View File

@@ -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 = {};

View File

@@ -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 };

View File

@@ -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<Part>' 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<Part>'.
tests/cases/conformance/types/conditional/conditionalTypes1.ts(159,5): error TS2322: Type 'ZeroOf<T>' 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<Part>' 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<Part>'.

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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.

View File

@@ -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]--;
~~~~~~~~

View File

@@ -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.

View File

@@ -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")'.

View File

@@ -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;

View File

@@ -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.
!!! error TS2540: Cannot assign to 'B' because it is a read-only property.

View File

@@ -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.

View File

@@ -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;

View File

@@ -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<Foo>'.
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<Bar>;
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<Bar>;
x5.a = 1;

View File

@@ -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<number>' 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.

View File

@@ -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".

View File

@@ -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".

View File

@@ -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.
}
}

View File

@@ -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.
}
}

View File

@@ -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) {}

View File

@@ -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;

View File

@@ -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
~~~~~

View File

@@ -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

View File

@@ -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;