-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
π Search Terms
- Anonymous function response
π Version & Regression Information
4.5 and below
β― Playground Link
Simplified:
Actual:
π» Code
function transform<O extends { [key: string]: (...args: any[]) => (arg: number) => void }>(input: O) {
}
transform({
fn1: (input: string) => (data) => {
},
f2: (input: string) => {
return (data) => { // coming back as any instead of number
}
},
fn3(input: string) {
return (data) => {
}
},
})π Actual behavior
The generic argument in the return function is coming back as any instead of number when it's returned as an anonymous inline function.
π Expected behavior
Expecting the inline anonymous function response to be of type number.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Type InferenceRelated to type inference performed during signature resolution or `infer` type resolutionRelated to type inference performed during signature resolution or `infer` type resolutionHelp WantedYou can do thisYou can do this