45 lines
No EOL
1.8 KiB
Text
45 lines
No EOL
1.8 KiB
Text
tests/cases/compiler/ambientWithStatements.ts(2,5): error TS1036: Statements are not allowed in ambient contexts.
|
|
tests/cases/compiler/ambientWithStatements.ts(3,5): error TS1104: A 'continue' statement can only be used within an enclosing iteration statement.
|
|
tests/cases/compiler/ambientWithStatements.ts(7,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
|
|
tests/cases/compiler/ambientWithStatements.ts(11,5): error TS1108: A 'return' statement can only be used within a function body.
|
|
tests/cases/compiler/ambientWithStatements.ts(25,11): error TS2410: All symbols within a 'with' block will be resolved to 'any'.
|
|
|
|
|
|
==== tests/cases/compiler/ambientWithStatements.ts (5 errors) ====
|
|
declare module M {
|
|
break;
|
|
~~~~~
|
|
!!! error TS1036: Statements are not allowed in ambient contexts.
|
|
continue;
|
|
~~~~~~~~~
|
|
!!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement.
|
|
debugger;
|
|
do { } while (true);
|
|
var x;
|
|
for (x in null) { }
|
|
~~~~
|
|
!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
|
|
if (true) { } else { }
|
|
1;
|
|
L: var y;
|
|
return;
|
|
~~~~~~
|
|
!!! error TS1108: A 'return' statement can only be used within a function body.
|
|
switch (x) {
|
|
case 1:
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
throw "nooo";
|
|
try {
|
|
}
|
|
catch (e) {
|
|
}
|
|
finally {
|
|
}
|
|
with (x) {
|
|
~
|
|
!!! error TS2410: All symbols within a 'with' block will be resolved to 'any'.
|
|
}
|
|
} |