34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
==== tests/cases/conformance/externalModules/initializersInDeclarations.ts (7 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 = [];
|
|
~
|
|
!!! error TS1039: Initializers are not allowed in ambient contexts.
|
|
declare var y = {};
|
|
~
|
|
!!! error TS1039: Initializers are not allowed in ambient contexts.
|
|
|
|
declare module M1 {
|
|
while(true);
|
|
~~~~~
|
|
!!! error TS1036: Statements are not allowed in ambient contexts.
|
|
|
|
export var v1 = () => false;
|
|
~
|
|
!!! error TS1039: Initializers are not allowed in ambient contexts.
|
|
} |