Closed
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"