-
Notifications
You must be signed in to change notification settings - Fork 1.1k
ClassCastException when summoning Mirror for hierarchical sum compiled by 3.0.x #13777
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
I'd say don't use the companion object as the mirror if it doesn't extend Mirror.Sum, but rather summon a local mirror. Any reason that can't be made to work? |
This sounds very reasonable to me. Summarising a Slack discussion: this change can be implemented in |
Btw, someone would've hit this during the RC cycle if they had a CI setup to test RCs. |
@bishabosha you fixing this? Otherwise I'll take it. |
should the community build have caught it? |
Currently, the community build rebuilds all transitive dependencies from sources, this is a great showcase of why we may want to also have a version of the community build which keeps the binary dependencies. |
@dwijnand you are very welcome to take this on |
@dwijnand are you still planning to work on this? It'd be great to get this in 3.1.1 which should be out soon as far as I can tell. |
I haven't forgotten it but I'm happy to hand it off if someone wants it. |
@dwijnand I have added a test case on the branch https://github.com/dotty-staging/dotty/tree/fix-13777 |
Compiler version
3.1.0
Minimized code
compile with Scala 3.0.2 to
out
dircompile with Scala 3.1.0 and with
out
on classpathOutput
runtime error:
This happens because
Top
is an eligible sum, and it has a companion object (which if compiled by Scala 3.1.0 would extendderiving.Mirror.Sum
), so the companion object is used as the mirror and is cast toSum
.Expectation
prevent summoning mirrors for hierarchical sums with companion objects compiled before 3.1.0
The text was updated successfully, but these errors were encountered: