You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resolving of conditional types involving unbound type arguments is deferred. The compiler doesn't know what type T is, so it can't resolve the conditional type.
This should really be added to the FAQ, given how often this gets reported (a lot).
I expect to be able to assign never to everything
You are. But in the case of y you're not trying to assign never, you're trying to assign an object.
π Search Terms
"never conditional not assignable"
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?ts=5.4.0-dev.20231128#code/C4TwDgpgBAYg9nAPAFQHxQLxQN4DcCGANgK4QBcUyAvgNwBQokUAQvgE4rpbJQQAewCADsAJgGcoxURABmASyEQRUAPw4CJcpSpQKeIqQrV6dGVIDGwOXCFQARu04AKAJQ46UT1HM2xwKHwU8EhomOoGWgAMUPgSirgQbLQeXj5CflAgFKwcoVj6mhTRsVDxicle3r7+AF7ZjnlQxXEQCWz0VEA
π» Code
π Actual behavior
Type '{ value: never; }' is not assignable to type 'Bar<T>'.
on theconst y
line, despite the fact that Bar should be equivalent to Fooπ Expected behavior
I expect to be able to assign never to everything
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: