1
+ tests/cases/compiler/f2.ts(7,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
2
+ tests/cases/compiler/f2.ts(8,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
1
3
tests/cases/compiler/f2.ts(9,7): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
4
+ 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.
5
+ 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.
6
+ tests/cases/compiler/f2.ts(17,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
7
+ tests/cases/compiler/f2.ts(18,1): error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
2
8
tests/cases/compiler/f2.ts(19,8): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
9
+ 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.
10
+ 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.
3
11
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'.
12
+ 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.
4
13
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'.
14
+ 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.
5
15
tests/cases/compiler/f2.ts(31,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
6
16
tests/cases/compiler/f2.ts(32,12): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
7
17
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'.
18
+ 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.
8
19
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'.
20
+ 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.
9
21
tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
10
22
tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
11
23
12
24
13
25
==== tests/cases/compiler/f1.ts (0 errors) ====
14
26
export var x = 1;
15
27
16
- ==== tests/cases/compiler/f2.ts (10 errors) ====
28
+ ==== tests/cases/compiler/f2.ts (22 errors) ====
17
29
18
30
// all mutations below are illegal and should be fixed
19
31
import * as stuff from './f1';
20
32
21
33
var n = 'baz';
22
34
23
35
stuff.x = 0;
36
+ ~~~~~~~
37
+ !!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
24
38
stuff['x'] = 1;
39
+ ~~~~~~~~~~
40
+ !!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
25
41
stuff.blah = 2;
26
42
~~~~
27
43
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
28
44
stuff[n] = 3;
29
45
30
46
stuff.x++;
47
+ ~~~~~~~
48
+ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
31
49
stuff['x']++;
50
+ ~~~~~~~~~~
51
+ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
32
52
stuff['blah']++;
33
53
stuff[n]++;
34
54
35
55
(stuff.x) = 0;
56
+ ~~~~~~~~~
57
+ !!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
36
58
(stuff['x']) = 1;
59
+ ~~~~~~~~~~~~
60
+ !!! error TS2450: Left-hand side of assignment expression cannot be a constant or a read-only property.
37
61
(stuff.blah) = 2;
38
62
~~~~
39
63
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
40
64
(stuff[n]) = 3;
41
65
42
66
(stuff.x)++;
67
+ ~~~~~~~~~
68
+ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
43
69
(stuff['x'])++;
70
+ ~~~~~~~~~~~~
71
+ !!! error TS2449: The operand of an increment or decrement operator cannot be a constant or a read-only property.
44
72
(stuff['blah'])++;
45
73
(stuff[n])++;
46
74
47
75
for (stuff.x in []) {}
48
76
~~~~~~~
49
77
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
50
78
for (stuff.x of []) {}
79
+ ~~~~~~~
80
+ !!! error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
51
81
for (stuff['x'] in []) {}
52
82
~~~~~~~~~~
53
83
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
54
84
for (stuff['x'] of []) {}
85
+ ~~~~~~~~~~
86
+ !!! error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
55
87
for (stuff.blah in []) {}
56
88
~~~~
57
89
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
@@ -65,10 +97,14 @@ tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist
65
97
~~~~~~~~~
66
98
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
67
99
for ((stuff.x) of []) {}
100
+ ~~~~~~~~~
101
+ !!! error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
68
102
for ((stuff['x']) in []) {}
69
103
~~~~~~~~~~~~
70
104
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
71
105
for ((stuff['x']) of []) {}
106
+ ~~~~~~~~~~~~
107
+ !!! error TS2485: The left-hand side of a 'for...of' statement cannot be a constant or a read-only property.
72
108
for ((stuff.blah) in []) {}
73
109
~~~~
74
110
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
0 commit comments