-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type parameter explicitly constrained by unknown
should not be assignable to {}
#26796
Comments
In the early days before We now have a proper top type called |
I would happily take the breaking change (under a new strict flag) for the soundness; in fact, I assumed it had come as part of If you don't want to do that, we could at least make a type parameter explicitly constrained by |
{}
but it might be null/undefinedunknown
should not be assignable to {}
Per notes in #26954, committed to trying it, at least |
The original issue here is actually not controversial. A type parameter with an explicit constraint of The larger issue is whether it is possible for us to switch the default constraint for type parameters to |
So, is it planned for next release ? |
TypeScript Version: master (2deb318)
Search Terms: conditional type variable parameter undefined null empty object constraint
Code
Expected behavior / Actual behavior: as marked
Playground Link: link (remember to enable
strictNullChecks
)Related Issues: didn't find any
Discovered via https://stackoverflow.com/questions/52105268 .
The text was updated successfully, but these errors were encountered: