-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
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
export const func = <T extends string>({ keys }: { keys: T[] }) => {
const firstKey = keys[0];
return {
keys,
firstKey
} as const;
};
// 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"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue