-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Incorrect code causes the parser to crash when trying to rewrite #22906
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
On Scala 3.3.5/3.6.4/3.7.0-RC1, I'm getting: -- Error: /Users/pchabelski/IdeaProjects/scala-cli-tests-3/scala-cli-tests-3/compiler-repro/repro.scala:1:37
1 |def program: Int => Int = {`1`: Int => 5}
| ^
|parentheses are required around the parameter of a lambda
|This construct can be rewritten automatically under -rewrite -source 3.0-migration.
1 error found when the parenthesis gets rewritten: def program: Int => Int = {(`1`: Int) => 5} the code seems to compile with no issue. @guofengzh am I missing something? I can't seem to reproduce the parser crash. |
Ah looking up the stack
or
so to reproduce
scala-cli directives are magical but only if we use them. You never know if trivial text changes will fool rewriting, since rewrite can be tricky.
|
@som-snytt thanks for nailing down the reproduction. |
It reproduces as
but not
I don't know if It also fails with whatever I published locally.
I forgot to try nightly. OK yes, fails on 3.nightly. |
Thanks for your kind response! |
Compiler version
Scala 3.6.4/3.7.0-RC1
Minimized code
Output (click arrow to expand)
The text was updated successfully, but these errors were encountered: