Suppose we have the same enum type in our core code and in our lib - one lib(main.ts) and one in (lib.ts). expectType does not work as expected here.
// main.ts
export enum Foo {
"A" = "A"
}
// lib.ts
export enum Foo {
"A" = "A"
}
// test.test-d.ts
import {Foo} from "./main"
import {Foo as Foo2} from "./lib"
const aFoo: Foo = Foo.A
const _aFoo2: Foo2 = aFoo // Assignment - OK
expectType<Foo2>(aFoo) // Expected to pass, but gives error `Parameter type Foo is not identical to argument type Foo.
Suppose we have the same enum type in our core code and in our lib - one lib(main.ts) and one in (lib.ts).
expectType
does not work as expected here.