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
Expected behavior:
Should be able to access private member in its declaring class.
Actual behavior:
Cannot access private member in its declaring class if the subclasses have different members and we narrow the type of this to a union type of its subclasses.
The text was updated successfully, but these errors were encountered:
Just looking at old bugs; this one was fixed in 3.9+ via #38277, though I'm not sure that the PR actually introduces a test for this particular case (though the underlying thing is in fact the same; this is narrowed to (this & Cat) | (this & Dog)).
TypeScript Version: 2.0.3
Code
Expected behavior:
Should be able to access private member in its declaring class.
Actual behavior:
Cannot access private member in its declaring class if the subclasses have different members and we narrow the type of
this
to a union type of its subclasses.The text was updated successfully, but these errors were encountered: