Elide import namespace from which only const enums are used (#20320)

This commit is contained in:
Wesley Wigham
2017-11-29 16:36:17 -08:00
committed by GitHub
parent 78250ec58f
commit a625dec58a
5 changed files with 144 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
// @filename: foo.ts
export const enum ConstFooEnum {
Some,
Values,
Here
};
export function fooFunc(): void { /* removed */ }
// @filename: index.ts
import * as Foo from "./foo";
function check(x: Foo.ConstFooEnum): void {
switch (x) {
case Foo.ConstFooEnum.Some:
break;
}
}