Microsoft/TypeScript

Incorrect completions in object literal expression for overloads

Open

#52,692 opened on 2023幎2月9日

GitHub で芋る
 (2 comments) (0 reactions) (0 assignees)TypeScript (6,726 forks)batch import
Domain: LS: Completion ListsExperience EnhancementHelp WantedSuggestion

Repository metrics

Stars
 (48,455 stars)
PR merge metrics
 (平均マヌゞ 6d 17h) (30d で 9 merged PRs)

説明

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)

コントリビュヌタヌガむド