allow const enum in type query (#21083)

This commit is contained in:
Wenlu Wang
2018-01-10 01:24:00 +08:00
committed by Mohamed Hegazy
parent ef5a289966
commit 062f97a6fa
8 changed files with 124 additions and 11 deletions

View File

@@ -0,0 +1,10 @@
const enum TestType { foo, bar }
type TestTypeStr = keyof typeof TestType;
function f1(f: TestType) { }
function f2(f: TestTypeStr) { }
f1(TestType.foo)
f1(TestType.bar)
f2('foo')
f2('bar')