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
What makes me think this is a bug (or at least can be added as a feature) is that this other similar code works. I've read the handbook and it seems that casting is an option, but the userId property is already part of both instances and I wouldn't want to add the boilerplate of casting when there's information right there.
The text was updated successfully, but these errors were encountered:
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.3.4 / Current playground version
Code
Expected behavior:
Code would compile, since by checking that the
userId
property is not undefined we definitely know we are handling anAuthenticatedProfile
instance.Actual behavior:
Type checks fail and you need workarounds such as the ones on this question: https://stackoverflow.com/q/44583342/625581.
What makes me think this is a bug (or at least can be added as a feature) is that this other similar code works. I've read the handbook and it seems that casting is an option, but the
userId
property is already part of both instances and I wouldn't want to add the boilerplate of casting when there's information right there.The text was updated successfully, but these errors were encountered: