-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Rewrite with of "onAction = _ => println("x")" with "-source:3.7-migration" leads to invalid code #23023
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
This duplicates #22731 but with the twist that the application is an assignment. That is an unusual signature, so I don't know what the check should do.
|
Closing as duplicate because I see the fix already does the reasonable thing (nothing) except for the reasonable case of a regular method call with parens. This is the patched:
|
I intended to add that it would be nice not to warn about assignment.
It would be nicer not to have an implicit parameter for an assignment method. |
@som-snytt there is still the same problem in 3.7.0-RC4. Code generated by "-rewrite -source 3.7-migration" is invalid and will not compile |
@jpsacha I think 3.7.0 branch requires backporting from main (which is future 3.7.1). During RC release process, probably they balance risk and urgency to decide whether to do that. on github, clicking on the commit shows what branch(es) it is on. |
Compiler version
"3.7.0-RC3"
Minimized code
This is the working code that I can minimize to. The code compiles file, but
scalac
option-source:3.7-migration
generates invalid codeOriginal file file:
ScalaFXHelloWorld.scala
:File
build.sbt
Output
When the code is build a warning is issued, but code copiles:
The rewritten code, the last line changed,
using
was added:This code will no longer compile.
Expectation
Re-generated code compiles without errors
See also: scalafx/scalafx#421
A simple SBT project is attaches
The text was updated successfully, but these errors were encountered: