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
The way type assertion works today is that it checks that at least one of the types is assignable to the other.. that usually means you can move up or down to a more specialized or less specialized type, (I => number[]
or number[] => I) but not side ways .
That said, @ahejlsberg is working on changing the comparable relationship to make it more permissive. by basically allowing all casts, unless we can prove that they are disjoint. that implies not checking non-shared propeortes, e.g. x in your example. so this should be allowed under the new proposal.
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.7.0-dev.20171109
Code
Expected behavior:
No error.
Actual behavior:
The text was updated successfully, but these errors were encountered: