Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expectType does not work for same enums from two different namespaces #219

Open
maximzavadskiy opened this issue Jul 12, 2024 · 0 comments

Comments

@maximzavadskiy
Copy link

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant