82 lines
No EOL
3.5 KiB
Text
82 lines
No EOL
3.5 KiB
Text
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(19,8): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
|
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(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(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(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(40,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
|
tests/cases/compiler/f2.ts(41,13): error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
|
|
|
|
|
==== tests/cases/compiler/f1.ts (0 errors) ====
|
|
export var x = 1;
|
|
|
|
==== tests/cases/compiler/f2.ts (10 errors) ====
|
|
|
|
// all mutations below are illegal and should be fixed
|
|
import * as stuff from 'f1';
|
|
|
|
var n = 'baz';
|
|
|
|
stuff.x = 0;
|
|
stuff['x'] = 1;
|
|
stuff.blah = 2;
|
|
~~~~
|
|
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
|
stuff[n] = 3;
|
|
|
|
stuff.x++;
|
|
stuff['x']++;
|
|
stuff['blah']++;
|
|
stuff[n]++;
|
|
|
|
(stuff.x) = 0;
|
|
(stuff['x']) = 1;
|
|
(stuff.blah) = 2;
|
|
~~~~
|
|
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
|
(stuff[n]) = 3;
|
|
|
|
(stuff.x)++;
|
|
(stuff['x'])++;
|
|
(stuff['blah'])++;
|
|
(stuff[n])++;
|
|
|
|
for (stuff.x in []) {}
|
|
~~~~~~~
|
|
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
|
for (stuff.x of []) {}
|
|
for (stuff['x'] in []) {}
|
|
~~~~~~~~~~
|
|
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
|
for (stuff['x'] of []) {}
|
|
for (stuff.blah in []) {}
|
|
~~~~
|
|
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
|
for (stuff.blah of []) {}
|
|
~~~~
|
|
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
|
for (stuff[n] in []) {}
|
|
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'.
|
|
for ((stuff.x) of []) {}
|
|
for ((stuff['x']) in []) {}
|
|
~~~~~~~~~~~~
|
|
!!! error TS2405: The left-hand side of a 'for...in' statement must be of type 'string' or 'any'.
|
|
for ((stuff['x']) of []) {}
|
|
for ((stuff.blah) in []) {}
|
|
~~~~
|
|
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
|
for ((stuff.blah) of []) {}
|
|
~~~~
|
|
!!! error TS2339: Property 'blah' does not exist on type 'typeof "tests/cases/compiler/f1"'.
|
|
for ((stuff[n]) in []) {}
|
|
for ((stuff[n]) of []) {}
|
|
|
|
|
|
|