-
Notifications
You must be signed in to change notification settings - Fork 186
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
ExplicitResultTypes
breaks compilation when using symbolic methods
#2166
Comments
Thanks for reporting, looks like an issue in the presentation compiler. We need to fix it upstream, but should be a quick fix. |
Supposedly fixed in the latest dotty snapshot thanks to scala/scala3#22485. It won't be backported to 3.5.x since it's EOL (and we follow the minor version of the sources to pick the presentation compiler), so I am afraid you will have to bump to 3.6.4 (assuming it does get in there - I am not familiar with the release/branching strategy). |
No worries, thank you all for the quick fix! |
It should be ported back to 3.3.6. |
Right 👍 I didn't mention it because the report mentioned a Scala version after LTS, but I certainly hope we can backport that to LTS! |
Hi folks,
ExplicitResultTypes
doesn't seem to work correctly when the def/val uses symbols, as it inserts:
right next to the symbol, which fools the Scala parser. Adding a space before the:
should resolve the issue.I'm not sure if this is part of the known limitations mentionned in the documentation page, as I haven't found an issue describing the problem.
How to reproduce
Here is a minimal example, using Scala 3.5.2 and sbt 1.10.7.
src/main/scala/Main.scala
:build.sbt
:project/plugins.sbt
:.scalafix.conf
:Running
sbt scalafix
produces the following line:which fails to compile. The following version:
would compile correctly.
The text was updated successfully, but these errors were encountered: