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

Scope confusion with reused signatures #58407

Closed
dragomirtitian opened this issue May 2, 2024 · 0 comments Β· Fixed by #58409
Closed

Scope confusion with reused signatures #58407

dragomirtitian opened this issue May 2, 2024 · 0 comments Β· Fixed by #58409
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@dragomirtitian
Copy link
Contributor

πŸ”Ž Search Terms

type aliasing isolated declarations

πŸ•— Version & Regression Information

  • This changed between versions 5.4 and 5.5beta

⏯ Playground Link

Playground

πŸ’» Code

// @strict: true
// @declaration: true

// @filename: a.ts
export interface A { a: number }
export const f = (x: A) => x as A;

// @filename: b.ts
import { f } from "./a";
export interface A { other: number }
export const g = f;

πŸ™ Actual behavior

g uses A as the parameter and return types

πŸ™‚ Expected behavior

g should use A from the module a instead

Additional information about the issue

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants