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
10 is assignable to type number.
When the first if condition is met, we know that, whatever T is, it is also assignable to type number.
This does not imply that 10 is assignable to T.
Narrowing currently works on a single variable, i.e. type of input inside these blocks would be number & T or string & T, but it does not narrow related types, i.e. T itself to a number or string. doing such non-local narrowing is fairly expensive.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.4.2
Code
Expected behavior:
No compiler error.
Actual behavior:
The text was updated successfully, but these errors were encountered: