2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/externalModules/initializersInDeclarations.ts(5,7): error TS1039: Initializers are not allowed in ambient contexts.
|
|
|
|
tests/cases/conformance/externalModules/initializersInDeclarations.ts(6,14): error TS1039: Initializers are not allowed in ambient contexts.
|
|
|
|
|
|
|
|
|
2014-11-19 23:01:03 +01:00
|
|
|
==== tests/cases/conformance/externalModules/initializersInDeclarations.ts (2 errors) ====
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
// Errors: Initializers & statements in declaration file
|
|
|
|
|
|
|
|
declare class Foo {
|
|
|
|
name = "test";
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1039: Initializers are not allowed in ambient contexts.
|
2014-07-13 01:04:16 +02:00
|
|
|
"some prop" = 42;
|
|
|
|
~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS1039: Initializers are not allowed in ambient contexts.
|
2014-07-13 01:04:16 +02:00
|
|
|
fn(): boolean {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var x = [];
|
|
|
|
declare var y = {};
|
|
|
|
|
|
|
|
declare module M1 {
|
|
|
|
while(true);
|
|
|
|
|
|
|
|
export var v1 = () => false;
|
|
|
|
}
|