Microsoft/TypeScript

Incorrect completions in object literal expression for overloads

Open

#52,692 创建于 2023年2月9日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)TypeScript (6,726 fork)batch import
Domain: LS: Completion ListsExperience EnhancementHelp WantedSuggestion

仓库指标

Star
 (48,455 star)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 9 个 PR)

描述

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)

贡献者指南