-
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
Synthetic CanEqual for primitives does not handle Nothing as a subtype #13739
Comments
I agree this should be fixed. |
nitpick: in Scala 3,
what are those issues — what are you doing with so far all I've found that fails is:
while the same thing with |
it might not be any extra work to cover, since if one side is |
@SethTisue 3e963c0 introduces CanEqual.canEqualOption[A] forcing a LUB computation as a workaround for this particular issue, which will occur for any type which would require derivation of CanEqual for a primitive and Nothing. Under 3.0.2 prior to the addition of the workaround this did not work: |
ah, I see #13512 now, I had not noticed that link before
and I see there was already some discussion on this at #12419 general reference on |
PR: #13828 |
As CanEqual is contravariant, this should be valid and is likely the root cause for issues around matching Nil/None under strict equality:
https://github.com/lampepfl/dotty/blob/370280bcfa96d1ea15e8b0b59f272dbbb3a982b9/compiler/src/dotty/tools/dotc/typer/Synthesizer.scala#L102-L114
The text was updated successfully, but these errors were encountered: