Hi,
TS: 1.4
To reproduce.
-
Create a TypeScript project in Visual Studio with "Compile on save" set to on.
-
Add file enums.d.ts with code:
declare module enums {
const enum Bar {
one = 0,
two = 1,
}
}
-
Add file foo.ts with code:
/// <reference path="enums.d.ts" />
var foo = enums.Bar.one;
-
Compile the project and check that the output foo.js is correct:
/// <reference path="enums.d.ts" />
var foo = 0 /* one */;
-
Now trigger compile-on-save by saving foo.ts.
-
The output in foo.js is now broken:
/// <reference path="enums.d.ts" />
var foo = enums.Bar.one;
The following point is relevant: If the enum declaration is moved to foo.ts then things work correctly.
This is a significant issue because the code fails with a runtime error.