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)

貢獻者指南