🔎 Search Terms
unbound generic, unbound type parameter
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ.
⏯ Playground Link
https://www.typescriptlang.org/play?jsx=0#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXwHcYoAHAHgA0A+ACgA8AueCgSiYG95Hn4BfAKFCRYCFOmx54YKBAhkAgvBB0MIVMADO8KKgCeAbQC6AGngAVWt07caAOnuwA5hqbyW8ALxVzfU-dtOLvBuTGb8-GB4GhjwECBQANaeUjIQNESkNGQW9KHuXlwspgCMLPwA9OXw1fAAegD8-EA
💻 Code
declare function wrap<X>(x: X): { x: X }
declare function call<A extends any[], T>(x: { x: (...args: A) => T }, ...args: A): T
const leak = call(wrap(<T>(x: T) => x), 1)
// ^? - const leak: A[0]
🙁 Actual behavior
The type of leak involves an unbound type parameter.
🙂 Expected behavior
The type of leak should be number.
Additional information about the issue
No response
🔎 Search Terms
unbound generic, unbound type parameter
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ.
⏯ Playground Link
https://www.typescriptlang.org/play?jsx=0#code/CYUwxgNghgTiAEAzArgOzAFwJYHtXwHcYoAHAHgA0A+ACgA8AueCgSiYG95Hn4BfAKFCRYCFOmx54YKBAhkAgvBB0MIVMADO8KKgCeAbQC6AGngAVWt07caAOnuwA5hqbyW8ALxVzfU-dtOLvBuTGb8-GB4GhjwECBQANaeUjIQNESkNGQW9KHuXlwspgCMLPwA9OXw1fAAegD8-EA
💻 Code
🙁 Actual behavior
The type of
leakinvolves an unbound type parameter.🙂 Expected behavior
The type of
leakshould benumber.Additional information about the issue
No response