Microsoft/TypeScript

Incorrect completions in object literal expression for overloads

Open

#52,692 opened on Feb 9, 2023

View on GitHub
ย (2 comments)ย (0 reactions)ย (0 assignees)TypeScriptย (48,455 stars)ย (6,726 forks)batch import
Domain: LS: Completion ListsExperience EnhancementHelp WantedSuggestion

Description

Bug Report

๐Ÿ”Ž Search Terms

๐Ÿ•— Version & Regression Information

โฏ Playground Link

ts play code

Code to test

Simplified from got typings.

interface T {
    <T>(input: { type: 'text' })
    <T>(input: { type: 'json' })
    <T>(input: { type: 'buffer' })
}

declare const func: T

func({ type: /**/ })

No all literal or in-string completions, but okay if remove <T> from each overload.

๐Ÿ™ Actual behavior

Completions in func({ type: '|' }) (text) missing completions from func2('|') (text, json, buffer)

๐Ÿ™‚ Expected behavior

Completions for func({ type: '|' }) are the same as for func2('|')

I'm not sure probably its related to https://github.com/microsoft/TypeScript/issues/51047 (or duplicate)

Contributor guide

Incorrect completions in object literal expression for overloads ยท Microsoft/TypeScript#52692 | Good First Issue