Accept new baselines

This commit is contained in:
Anders Hejlsberg 2016-10-30 18:09:07 -07:00
parent 6c205330a1
commit 88961cd164
18 changed files with 285 additions and 285 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,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/abstractPropertyNegative.ts(19,3): error TS2540: Cannot assign to 'ro' because it is a constant or a read-only property.
tests/cases/compiler/abstractPropertyNegative.ts(24,7): error TS2415: Class 'WrongTypePropertyImpl' incorrectly extends base class 'WrongTypeProperty'.
Types of property 'num' are incompatible.
Type 'string' is not assignable to type 'number'.
@ -58,8 +58,8 @@ tests/cases/compiler/abstractPropertyNegative.ts(41,18): error TS2676: Accessors
}
let c = new C();
c.ro = "error: lhs of assignment can't be readonly";
~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~
!!! error TS2540: Cannot assign to 'ro' because it is a constant or a read-only property.
abstract class WrongTypeProperty {
abstract num: number;

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,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/assignToEnum.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/assignToEnum.ts(4,3): error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property.
tests/cases/compiler/assignToEnum.ts(5,3): error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property.
==== tests/cases/compiler/assignToEnum.ts (4 errors) ====
@ -13,10 +13,10 @@ tests/cases/compiler/assignToEnum.ts(5,1): error TS2450: Left-hand side of assig
~
!!! error TS2539: Cannot assign to 'A' because it is not a variable.
A.foo = 1; // invalid LHS
~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~
!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property.
A.foo = A.bar; // invalid LHS
~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~
!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property.

View file

@ -1,7 +1,7 @@
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(11,1): error TS2304: Cannot find name 'M'.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(14,1): error TS2539: Cannot assign to 'C' because it is not a variable.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(17,1): error TS2539: Cannot assign to 'E' because it is not a variable.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(18,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(21,1): error TS2539: Cannot assign to 'fn' because it is not a variable.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): error TS2693: 'I' only refers to a type, but is being used as a value here.
@ -31,8 +31,8 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): er
~
!!! error TS2539: Cannot assign to 'E' because it is not a variable.
E.A = null; // OK per spec, Error per implementation (509581)
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
function fn() { }
fn = null; // Should be error

View file

@ -1,20 +1,20 @@
tests/cases/compiler/constDeclarations-access3.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(21,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(22,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(24,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(8,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(9,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(10,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(11,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(12,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(13,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(14,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(15,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(16,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(17,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(18,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(19,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(21,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(22,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(23,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(24,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(26,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access3.ts(28,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
@ -27,58 +27,58 @@ tests/cases/compiler/constDeclarations-access3.ts(28,1): error TS2450: Left-hand
// Errors
M.x = 1;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x += 2;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x -= 3;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x *= 4;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x /= 5;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x %= 6;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x <<= 7;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x >>= 8;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x >>>= 9;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x &= 10;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x |= 11;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x ^= 12;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x++;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x--;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
++M.x;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
--M.x;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
++((M.x));
~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M["x"] = 0;
~~~~~~

View file

@ -1,20 +1,20 @@
tests/cases/compiler/constDeclarations-access4.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(16,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(21,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(22,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(23,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(24,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(8,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(9,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(10,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(11,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(12,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(13,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(14,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(15,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(16,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(17,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(18,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(19,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(21,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(22,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(23,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(24,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(26,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations-access4.ts(28,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
@ -27,58 +27,58 @@ tests/cases/compiler/constDeclarations-access4.ts(28,1): error TS2450: Left-hand
// Errors
M.x = 1;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x += 2;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x -= 3;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x *= 4;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x /= 5;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x %= 6;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x <<= 7;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x >>= 8;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x >>>= 9;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x &= 10;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x |= 11;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x ^= 12;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x++;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M.x--;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
++M.x;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
--M.x;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
++((M.x));
~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
M["x"] = 0;
~~~~~~

View file

@ -1,20 +1,20 @@
tests/cases/compiler/constDeclarations_access_2.ts(4,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(5,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(6,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(11,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(12,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(13,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(14,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(15,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(17,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(18,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(19,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(20,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(22,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(4,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(5,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(6,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(7,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(8,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(9,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(10,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(11,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(12,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(13,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(14,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(15,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(17,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(18,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(19,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(20,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(22,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/constDeclarations_access_2.ts(24,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
@ -23,58 +23,58 @@ tests/cases/compiler/constDeclarations_access_2.ts(24,1): error TS2450: Left-han
import m = require('constDeclarations_access_1');
// Errors
m.x = 1;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x += 2;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x -= 3;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x *= 4;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x /= 5;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x %= 6;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x <<= 7;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x >>= 8;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x >>>= 9;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x &= 10;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x |= 11;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x ^= 12;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m
m.x++;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m.x--;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
++m.x;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
--m.x;
~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
++((m.x));
~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
m["x"] = 0;
~~~~~~

View file

@ -1,7 +1,7 @@
tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(14,9): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment.
tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(15,12): error TS2476: A const enum member can only be accessed using a string literal.
tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(17,1): error TS2322: Type '"string"' is not assignable to type 'G'.
tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,3): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property.
==== tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts (4 errors) ====
@ -30,6 +30,6 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(19,1): error TS24
!!! error TS2322: Type '"string"' is not assignable to type 'G'.
function foo(x: G) { }
G.B = 3;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property.

View file

@ -1,5 +1,5 @@
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(6,25): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,23): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(10,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'.
@ -15,8 +15,8 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp
~~~~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
var ResultIsNumber2 = ENUM1.A--;
~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
// miss assignment operator
--ENUM1["A"];

View file

@ -1,21 +1,21 @@
tests/cases/compiler/f2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(7,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/f2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(9,7): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
tests/cases/compiler/f2.ts(12,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(12,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/f2.ts(13,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(17,8): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/f2.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(19,8): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
tests/cases/compiler/f2.ts(22,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(22,8): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/f2.ts(23,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(27,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
tests/cases/compiler/f2.ts(28,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(27,12): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/f2.ts(28,12): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/f2.ts(29,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
tests/cases/compiler/f2.ts(30,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(31,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
tests/cases/compiler/f2.ts(32,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
tests/cases/compiler/f2.ts(36,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
tests/cases/compiler/f2.ts(37,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(36,13): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/f2.ts(37,13): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/compiler/f2.ts(38,6): error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
tests/cases/compiler/f2.ts(39,6): error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
@ -33,8 +33,8 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist
var n = 'baz';
stuff.x = 0;
~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
stuff['x'] = 1;
~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
@ -44,8 +44,8 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist
stuff[n] = 3;
stuff.x++;
~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
stuff['x']++;
~~~~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
@ -53,8 +53,8 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist
stuff[n]++;
(stuff.x) = 0;
~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
(stuff['x']) = 1;
~~~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
@ -64,8 +64,8 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist
(stuff[n]) = 3;
(stuff.x)++;
~~~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
(stuff['x'])++;
~~~~~~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
@ -73,11 +73,11 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist
(stuff[n])++;
for (stuff.x in []) {}
~~~~~~~
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
for (stuff.x of []) {}
~~~~~~~
!!! error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
for (stuff['x'] in []) {}
~~~~~~~~~~
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
@ -94,11 +94,11 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist
for (stuff[n] of []) {}
for ((stuff.x) in []) {}
~~~~~~~~~
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
for ((stuff.x) of []) {}
~~~~~~~~~
!!! error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
for ((stuff['x']) in []) {}
~~~~~~~~~~~~
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.

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,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/externalModules/b.ts(9,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/externalModules/b.ts(8,4): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/conformance/externalModules/b.ts(9,4): error TS2540: Cannot assign to 'y' because it is a constant or a read-only property.
==== tests/cases/conformance/externalModules/b.ts (4 errors) ====
@ -17,11 +17,11 @@ tests/cases/conformance/externalModules/b.ts(9,1): error TS2450: Left-hand side
~
!!! error TS2539: Cannot assign to 'y' because it is not a variable.
a1.x = 1; // Error
~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
a1.y = 1; // Error
~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'y' because it is a constant or a read-only property.
a2.x = 1;
a2.y = 1;
a3.x = 1;

View file

@ -1,7 +1,7 @@
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(6,25): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,23): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(10,3): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,1): error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,7): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property.
==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts (4 errors) ====
@ -14,8 +14,8 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp
~~~~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
var ResultIsNumber2 = ENUM1.B++;
~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property.
// miss assignment operator
++ENUM1["B"];
@ -23,5 +23,5 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
ENUM1.B++;
~~~~~~~
!!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property.

View file

@ -1,8 +1,8 @@
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(21,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(23,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(17,6): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,15): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
==== tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts (5 errors) ====
@ -23,22 +23,22 @@ tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,1): er
}
let base: Base;
base.value = 12 // error, lhs can't be a readonly property
~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~~~
!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
let identical: Base & Identical;
identical.value = 12; // error, lhs can't be a readonly property
~~~~~~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~~~
!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
let mutable: Base & Mutable;
mutable.value = 12; // error, lhs can't be a readonly property
~~~~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~~~
!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
let differentType: Base & DifferentType;
differentType.value = 12; // error, lhs can't be a readonly property
~~~~~~~~~~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~~~
!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
let differentName: Base & DifferentName;
differentName.value = 12; // error, property 'value' doesn't exist
~~~~~~~~~~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~~~
!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.

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,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(5,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(9,1): error TS2539: Cannot assign to 'C' because it is not a variable.
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(14,1): error TS2693: 'I' only refers to a type, but is being used as a value here.
tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(17,1): error TS2539: Cannot assign to 'M' because it is not a variable.
@ -14,8 +14,8 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.t
~
!!! error TS2539: Cannot assign to 'E' because it is not a variable.
E.A = x;
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
class C { foo: string }
var f: C;

View file

@ -1,4 +1,4 @@
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(13,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(13,14): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(33,7): error TS2415: Class 'E' incorrectly extends base class 'D'.
Property 'x' is private in type 'D' but not in type 'E'.
@ -17,8 +17,8 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/re
super(x);
// Fails, x is readonly
this.x = 1;
~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
}
}

View file

@ -1,4 +1,4 @@
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(4,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(4,10): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(7,26): error TS1029: 'public' modifier must precede 'readonly' modifier.
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(13,10): error TS2341: Property 'x' is private and only accessible within class 'F'.
@ -8,8 +8,8 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/re
constructor(readonly x: number) {}
}
new C(1).x = 2;
~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property.
class E {
constructor(readonly public x: number) {}

View file

@ -1,16 +1,16 @@
tests/cases/compiler/readonlyMembers.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(17,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(19,13): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(20,13): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(21,13): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(25,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(26,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(27,9): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(36,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(40,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(49,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(56,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(7,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(8,3): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(17,14): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(19,18): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(20,18): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(21,18): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(25,14): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(26,14): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(27,14): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(36,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(40,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(49,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(56,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(62,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
@ -23,11 +23,11 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a
}
var x: X = { a: 0 };
x.a = 1; // Error
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
x.b = 1; // Error
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property.
class C {
readonly a: number;
@ -37,30 +37,30 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a
this.a = 1; // Ok
this.b = 1; // Ok
this.c = 1; // Error
~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property.
const f = () => {
this.a = 1; // Error
~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
this.b = 1; // Error
~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property.
this.c = 1; // Error
~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property.
}
}
foo() {
this.a = 1; // Error
~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
this.b = 1; // Error
~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property.
this.c = 1; // Error
~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property.
}
}
@ -70,14 +70,14 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a
set b(value) { }
};
o.a = 1; // Error
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
o.b = 1;
var p: { readonly a: number, b: number } = { a: 1, b: 1 };
p.a = 1; // Error
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
p.b = 1;
var q: { a: number, b: number } = p;
q.a = 1;
@ -87,8 +87,8 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a
A, B, C
}
E.A = 1; // Error
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
namespace N {
export const a = 1;
@ -96,8 +96,8 @@ tests/cases/compiler/readonlyMembers.ts(65,1): error TS2450: Left-hand side of a
export var c = 1;
}
N.a = 1; // Error
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property.
N.b = 1;
N.c = 1;

View file

@ -1,7 +1,7 @@
tests/cases/conformance/types/union/unionTypeReadonly.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/union/unionTypeReadonly.ts(19,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/union/unionTypeReadonly.ts(21,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/union/unionTypeReadonly.ts(23,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/union/unionTypeReadonly.ts(17,6): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
tests/cases/conformance/types/union/unionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
tests/cases/conformance/types/union/unionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
tests/cases/conformance/types/union/unionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
tests/cases/conformance/types/union/unionTypeReadonly.ts(25,15): error TS2339: Property 'value' does not exist on type 'Base | DifferentName'.
Property 'value' does not exist on type 'DifferentName'.
@ -24,20 +24,20 @@ tests/cases/conformance/types/union/unionTypeReadonly.ts(25,15): error TS2339: P
}
let base: Base;
base.value = 12 // error, lhs can't be a readonly property
~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~~~
!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
let identical: Base | Identical;
identical.value = 12; // error, lhs can't be a readonly property
~~~~~~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~~~
!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
let mutable: Base | Mutable;
mutable.value = 12; // error, lhs can't be a readonly property
~~~~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~~~
!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
let differentType: Base | DifferentType;
differentType.value = 12; // error, lhs can't be a readonly property
~~~~~~~~~~~~~~~~~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~~~~~
!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property.
let differentName: Base | DifferentName;
differentName.value = 12; // error, property 'value' doesn't exist
~~~~~

View file

@ -1,4 +1,4 @@
tests/cases/conformance/types/primitives/null/validNullAssignments.ts(10,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
tests/cases/conformance/types/primitives/null/validNullAssignments.ts(10,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
tests/cases/conformance/types/primitives/null/validNullAssignments.ts(15,1): error TS2539: Cannot assign to 'C' because it is not a variable.
tests/cases/conformance/types/primitives/null/validNullAssignments.ts(20,1): error TS2693: 'I' only refers to a type, but is being used as a value here.
tests/cases/conformance/types/primitives/null/validNullAssignments.ts(23,1): error TS2539: Cannot assign to 'M' because it is not a variable.
@ -16,8 +16,8 @@ tests/cases/conformance/types/primitives/null/validNullAssignments.ts(30,1): err
enum E { A }
E.A = null; // error
~~~
!!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
~
!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
class C { foo: string }
var f: C;