Skip to content

TS 4.8 Generics completion is now weaker. #50680

Description

@eretica

Bug Report
🔎 Search Terms
Generics completion is now weaker.

🕗 Version & Regression Information
This changed between versions 4.7.4 and 4.8.2
Playground Link

💻 Code

exportconstfunc=<Textendsstring>({ keys }: {keys: T[]})=>{constfirstKey=keys[0];return{
keys,
firstKey
}asconst;};// 4.8.2 firstKey string// 4.7.4 firstKey "aa" | "bb"const{ keys, firstKey }=func({keys: ["aa","bb"]})

🙁 Actual behavior

4.8.2 firstKey type of string

🙂 Expected behavior
firstKey type of "aa" | "bb"

Metadata

Metadata

Labels

BugA bug in TypeScriptFix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions