TypeScript/tests/cases/conformance/constEnums/constEnum3.ts
2018-01-09 09:24:00 -08:00

11 lines
192 B
TypeScript

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