mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
allow const enum in type query (#21083)
This commit is contained in:
committed by
Mohamed Hegazy
parent
ef5a289966
commit
062f97a6fa
@@ -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')
|
||||
Reference in New Issue
Block a user