With function foo<T>(value: T), the inferred type is loosen 123 -> number, but as soon as I have function foo<T extends string | number>(value: T), it's got narrowed 123 -> 123. I would expect it to keep the same behavior unless using const T. Is there a way to use extends while keeping loosening type?
The Playground lets you write TypeScript or JavaScript online in a safe and sharable way.