TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Scope confusion with reused signatures

Open dragomirtitian opened this issue 9 months ago • 0 comments

🔎 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

dragomirtitian avatar May 02 '24 20:05 dragomirtitian