mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
24 lines
437 B
TypeScript
24 lines
437 B
TypeScript
//// [tests/cases/conformance/constEnums/constEnum3.ts] ////
|
|
|
|
//// [constEnum3.ts]
|
|
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')
|
|
|
|
|
|
//// [constEnum3.js]
|
|
"use strict";
|
|
function f1(f) { }
|
|
function f2(f) { }
|
|
f1(0 /* TestType.foo */);
|
|
f1(1 /* TestType.bar */);
|
|
f2('foo');
|
|
f2('bar');
|