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
InjectedController trait not working with scala 3 #12272
Comments
Can confirm, taking a look already. Thanks a lot for the report! |
Pretty sure I nailed it down: Scala 2.13:
Scala 3:
So you see Scala 3 marks the method as synthetic bridge method ( Guice however ignores such methods: Need to find a workaround... |
Thanks for the quick feedback and for your work on Play! 👏🏻 Seems pretty low level stuff (scala compiler...), I don't know why they changed this in scala 3. One can still use AbstractController instead of InjectedController but if there's a way to make it work that would be better. |
This is definitely regression / breaking change in Scala 3 compiler |
So I tried lots of stuff, but couldn't make it work, and at this point I also believe this is a bug in the Scala 3 compiler, but I am not 100% sure, so I leave the judgment to the experts: |
So according to scala/scala3#19270 (comment) this is a problem in the Scala 3 compiler. Let's leave the things how they are currently and let's hope they fix it with Scala 3.3.3 (3.3.2 is in RC phase already, so no chance anymore) |
Thanks for the follow up! |
Should this be added to the migration notes? It hit us in production (we only used the InjectedController in one rarely visited spot 🙈 ), and might hit others migrating to play 2.9/3.0. If there's interest I would open a doc pull-request to add a short warning to: https://www.playframework.com/documentation/2.9.x/Scala3Migration |
@aumann Yes sure, please go for it, thanks! |
Play Version
Play 3.0.0
API
Scala 3
Operating System
Fedora 38
JDK
openjdk version "17.0.9" 2023-10-17
openjdk version "11.0.21" 2023-10-17
Library Dependencies
None
Expected Behavior
Actual Behavior
Reproducible Test Case
I reproduced this bug with some minor tweaks to play-samples/play-scala-hello-world-tutorial code.
sbt run
http://localhost:9000/
to get the error (this is the one listed in the previous step)Note: exact same code works if you switch back to scala "2.13.12" and Play serves the "Play Hello World Web Tutorial" page
The text was updated successfully, but these errors were encountered: