1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
tests/cases/conformance/externalModules/file1.d.ts(5,9): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(6,16): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(7,16): error TS1183: An implementation cannot be declared in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(12,15): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(13,15): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(16,2): error TS1036: Statements are not allowed in ambient contexts.
tests/cases/conformance/externalModules/file1.d.ts(18,16): error TS1039: Initializers are not allowed in ambient contexts.
==== tests/cases/conformance/externalModules/file1.d.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 TS1183: 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.
}
|