Intellisense displays function props instead of object's in generic function overload
Opened this issue ยท 0 comments
kinderswan commented
๐ Search Terms
function, overload, overloading, overload order, generic functions, intellisense
๐ Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about 5.9.3
โฏ Playground Link
๐ป Code
declare function task<T>(make: () => T): void
declare function task<T>(arg: {make: () => T}): void
task({
// displays function internals
})
declare function task2<T>(arg: {make: () => T}): void
declare function task2<T>(make: () => T): void
task2({
// displays make as needed
})
declare function task3(make: () => any): void
declare function task3(arg: {make: () => any}): void
task3({
// displays make as needed
})๐ Actual behavior
Intellisense displays the function internals, like bind, call, apply instead of displaying the property of the object passed

It depends on the order how the overloads are provided. If I change them and put the object first - it displays the object props as needed
Without generic parameter it also works as needed
๐ Expected behavior
The order of function overloads doesn't matter and doesn't affect intellisense suggestions
Additional information about the issue
No response