Closed
Description
π Search Terms
const enum
π Version & Regression Information
not sure, i think it has been like this for a long time, still present in latest version 5.7.2
β― Playground Link
π» Code
export const enum Test {
A = 300,
B = 123
}
const testFn = (a: Test) => a
testFn(Test.A)
// error as expected
testFn(2)
const testIndirectCall = (a: number) => testFn(a) // it should error here as well
// literal type
export type TestLiteralType = 300 | 123
const testFn2 = (a: TestLiteralType) => a
testFn2(Test.A)
// error as expected
testFn2(2)
const testIndirectCall2 = (a: number) => testFn2(a) // error as expected
π Actual behavior
as noted in above
π Expected behavior
as noted in above
Additional information about the issue
No response