TypeScript/tests/baselines/reference/initializersInDeclarations.errors.txt
2014-11-18 22:37:31 -08:00

34 lines
No EOL
1.4 KiB
Text

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.
tests/cases/conformance/externalModules/initializersInDeclarations.ts(7,16): error TS1037: A function implementation cannot be declared in an ambient context.
tests/cases/conformance/externalModules/initializersInDeclarations.ts(16,2): error TS1036: Statements are not allowed in ambient contexts.
==== tests/cases/conformance/externalModules/initializersInDeclarations.ts (4 errors) ====
// Errors: Initializers & statements in declaration file
declare class Foo {
name = "test";
~
!!! error TS1039: Initializers are not allowed in ambient contexts.
"some prop" = 42;
~
!!! error TS1039: Initializers are not allowed in ambient contexts.
fn(): boolean {
~
!!! error TS1037: A function implementation cannot be declared in an ambient context.
return false;
}
}
declare var x = [];
declare var y = {};
declare module M1 {
while(true);
~~~~~
!!! error TS1036: Statements are not allowed in ambient contexts.
export var v1 = () => false;
}