We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
automatically infer
No response
function test<T>(t1: T, t2: T): never { throw Error('todo'); } function custom<T>(f: (data: T) => T): T { throw Error('todo'); } async function main() { test(10, custom((data) => { throw Error('todo') })) }
Function custom correctly inffered
custom
function test<T>(options: { t1: T, t2: T }): never { throw Error('todo'); } function custom<T>(f: (data: T) => T): T { throw Error('todo'); } async function main() { test({ t1: 10, t2: custom((data) => { throw Error('todo') }) }) }
Function custom incorrectly inffered, the T should be number instead of unknown
T
number
unknown
Function custom incorrectly infered, the T infered as unknown
Function custom correctly infered, the T infered as number
The text was updated successfully, but these errors were encountered:
#47599
Sorry, something went wrong.
This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
π Search Terms
automatically infer
π Version & Regression Information
β― Playground Link
No response
π» Code
There is no issue
Function
custom
correctly infferedThere is issue
Function
custom
incorrectly inffered, theT
should benumber
instead ofunknown
π Actual behavior
Function
custom
incorrectly infered, theT
infered asunknown
π Expected behavior
Function
custom
correctly infered, theT
infered asnumber
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: