-
Notifications
You must be signed in to change notification settings - Fork 12.8k
InstanceOf incorrectly narrow when two type extends same base class #10422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can remove Isn't this because The PR #10216 addressed a very similar situation raised in #7271, but the problem and the fix addressed the situation where unrelated classes were structurally identical. This is a case where unrelated classes have a structural subtype-supertype relationship. You can see the same behaviour with the first example in #7271 (comment). |
@yortus thanks for correcting my example! Yes, it is because This example is slight different from the example in your comment comment in that we will treat user-defined typeguard and |
@yuit this behaviour was the same before #10216 was merged - you can see it for example using |
That is a current design limitation with structural comparison. |
So when will this bug be fixed? |
Version: master
The change is a result of the PR #10216. It is followed the specification in that PR. Though I wonder whether this should get treated differently.
The text was updated successfully, but these errors were encountered: