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
Duplicate (or at least heavily related): #35236 / #35850.
A void return type does not mean "nothing". It means "anything, but you shouldn't use this for anything". It could be a undefined, but it could just as well be a string. It can be truthy or falsy.
When you use this javascript back as typescript the b will be of type string | null and not string | null | void
Shouldn't typescript be consistent with resulting javascript?
TypeScript Version: 3.7.x-dev.201xxxxx
Search Terms: null coalesce void, void null, void is not assignable
Code
Expected behavior:
Should compile with no errors, resulting type is "null | string"
Actual behavior:
Error:
Resulting type is "null | void | string"
Playground Link: Playground Link
Related Issues: didn't find any related issues
The text was updated successfully, but these errors were encountered: