swc/crates/swc_ecma_parser/tests/tsc/constEnum3.ts

11 lines
192 B
TypeScript
Raw Normal View History

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')