-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Can one disable eqAny? #2707
Comments
Oh, |
Disabling If phantom classes are added, making |
Last: @smarter proposed earlier for |
There is now a dedicated way to disable scala> import scala.language.strictEquality
| object Main {
| def equal[S, T](s: S, t: T) = s == t
| }
// defined object Main This seems to be as specified in https://github.com/lampepfl/dotty/blob/36740bf877869fd226618537b3aa677459676f83/docs/docs/reference/other-new-features/multiversal-equality.md:
The linked issue (#1247 (comment)) defines
Which means that: |
https://www.reddit.com/r/programming/comments/6elim6/announcing_dotty_012rc1_a_major_step_towards/dik7j1b/ points out that this code compiles, unlike I would have expected:
The second import tried to prevent the
Eq
instance from being found. But using-Xprint:all
suggestsEq
instances don't come into play. I suspect something like this should be a testcase.I don't know what should be the way to disable
eqAny
, but I do think it should be possible and that seems the appropriate syntax. In particular, this example appears to contradict this quote from #1247:This bug and #2698 might need to be fixed in cooperation.
The text was updated successfully, but these errors were encountered: