TypeScript Version: 2.4.1
Code
file1.ts
export enum Colors {
Red = "RED",
Green = "GREEN",
Blue = "BLUE"
}
export enum Numbers {
ONE = 1,
TWO = 2
}
file2.ts
import { Colors, Numbers } from "./file1";
Expected behavior:
Colors and Numbers should not be undefined in file2.
Colors should be:
{
Red: "RED",
Green: "GREEN",
Blue: "BLUE"
}
Numbers should be
{
ONE: 1,
TWO: 2
1: "ONE"
2: "TWO"
}
Actual behavior:
Colors and Numbers are undefined.
Any enum entry requested fail with "Cannot read property 'enum entry' of undefined".
It seems that this only occurs in case of a circular dependency.
If you remove the circular dependency everything seems to work fine.
TypeScript Version: 2.4.1
Code
Expected behavior:
Colors and Numbers should not be undefined in file2.
Colors should be:
Numbers should be
Actual behavior:
Colors and Numbers are undefined.
Any enum entry requested fail with "Cannot read property 'enum entry' of undefined".
It seems that this only occurs in case of a circular dependency.
If you remove the circular dependency everything seems to work fine.