-
Notifications
You must be signed in to change notification settings - Fork 14
(tp1 =:= tp2) != (tp1 <:< tp2) && (tp2 <:< tp1) #530
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
The comment is just one example of how isSameType is wrong. Here's a simpler one: |
That's according to the spec, tho it's most clearly not defensible — it follows from SLS 3.5.1 (same quote as in scala/scala3#4781 (comment)):
|
You're right -- good point, but I don't think that's a very intuitive definition of type equality. Witness the implementation in dotty :-) EDIT: yes, I realize compound types and intersection types are not the same thing, and I guess we may be stuck with this in Scala 2, but I don't see why type equality should encode properties related to member selection (linearisation). Especially for the original example: |
Oh sure, I'm not defending the spec — I'm happy for every change that can be imported in Scala 2, I just dunno how easy that is. |
This hack relies on a Scala 2 bug (see scala/scala-dev#530). This won't be supported in Dotty
Uh oh!
There was an error while loading. Please reload this page.
isSameType does not correspond to isSubtype the way you'd expected. Specifically, the case for refined types looks wrong (though compact):
Inlining the case for refined types of the definition of subtyping (in both directions), you'd expect something equivalent to:
The above uses a more restricted form of scope equality:
The text was updated successfully, but these errors were encountered: