- Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScript
Description
🔎 Search Terms
type variable leak
🕗 Version & Regression Information
This is the behavior in 5.8.3 and nightly build
⏯ Playground Link
💻 Code
declarefunctioncall<A,R>(obj: {x: (a: A)=>R},arg: A): Rdeclarefunctionwrap<X>(x: X): {x: X}declarefunctionid<T>(x: T): T;constleak1=call(wrap(id),1)// Type variable leak and odd errorconstleak2=call(wrap(id),1asany)// Type variable leak🙁 Actual behavior
The type of the two variables is A, a leaked type variable.
🙂 Expected behavior
No leaks.
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript