-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editor
Milestone
Description
π 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
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: LS: Completion ListsThe issue relates to showing completion lists in an editorThe issue relates to showing completion lists in an editor