TypeScript/tests/baselines/reference/ambientWithStatements.errors.txt

45 lines
1.8 KiB
Plaintext
Raw Normal View History

tests/cases/compiler/ambientWithStatements.ts(2,5): error TS1036: Statements are not allowed in ambient contexts.
2014-12-17 04:11:07 +01:00
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.
2014-12-17 04:11:07 +01:00
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'.
2014-12-17 04:40:22 +01:00
==== tests/cases/compiler/ambientWithStatements.ts (5 errors) ====
2014-07-13 01:04:16 +02:00
declare module M {
break;
~~~~~
!!! error TS1036: Statements are not allowed in ambient contexts.
2014-07-13 01:04:16 +02:00
continue;
2014-12-17 04:11:07 +01:00
~~~~~~~~~
!!! error TS1104: A 'continue' statement can only be used within an enclosing iteration statement.
2014-07-13 01:04:16 +02:00
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.
2014-07-13 01:04:16 +02:00
if (true) { } else { }
1;
L: var y;
return;
~~~~~~
2014-12-17 04:11:07 +01:00
!!! error TS1108: A 'return' statement can only be used within a function body.
2014-07-13 01:04:16 +02:00
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'.
2014-07-13 01:04:16 +02:00
}
}