mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-26 10:43:51 -05:00
allow const enum in type query (#21083)
This commit is contained in:
committed by
Mohamed Hegazy
parent
ef5a289966
commit
062f97a6fa
10
tests/cases/conformance/constEnums/constEnum3.ts
Normal file
10
tests/cases/conformance/constEnums/constEnum3.ts
Normal 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')
|
||||
Reference in New Issue
Block a user