TypeScript
TypeScript copied to clipboard
Scope confusion with reused signatures
🔎 Search Terms
type aliasing isolated declarations
🕗 Version & Regression Information
- This changed between versions 5.4 and 5.5beta
⏯ Playground Link
💻 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