43 lines
No EOL
2 KiB
Text
43 lines
No EOL
2 KiB
Text
tests/cases/conformance/externalModules/initializersInDeclarations.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts.
|
|
tests/cases/conformance/externalModules/initializersInDeclarations.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts.
|
|
tests/cases/conformance/externalModules/initializersInDeclarations.ts(7,16): error TS1184: An implementation cannot be declared in ambient contexts.
|
|
tests/cases/conformance/externalModules/initializersInDeclarations.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts.
|
|
tests/cases/conformance/externalModules/initializersInDeclarations.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts.
|
|
tests/cases/conformance/externalModules/initializersInDeclarations.ts(16,2): error TS1036: Statements are not allowed in ambient contexts.
|
|
tests/cases/conformance/externalModules/initializersInDeclarations.ts(18,16): error TS1039: Initializers are not allowed in ambient contexts.
|
|
|
|
|
|
==== 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 TS1184: An implementation cannot be declared in ambient contexts.
|
|
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.
|
|
} |