Microsoft/TypeScript

Incorrect completions in object literal expression for overloads

Open

#52.692 geöffnet am 9. Feb. 2023

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (6.726 Forks)batch import
Domain: LS: Completion ListsExperience EnhancementHelp WantedSuggestion

Repository-Metriken

Stars
 (48.455 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 6T 17h) (9 gemergte PRs in 30 T)

Beschreibung

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