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
rewrite rules for scala 3 breaks compilation #3337
Comments
this syntax is not yet allowed on scala213source3 dialect. |
That's weird, I thought it's supported based on scala/scala#9584 |
It does compile for me 🤔 |
you're right! |
so it's really a special case:
can you test with that ? it gets rewritte to below, which doesn't compile.
|
Looks like it should get rewritten to |
I can do a workaround for this, by extracting the value first. |
That might be a good workaround for now, though we should fix it in scalafmt. I think it might have soemthing to do with operator precedence 🤔 |
scalafmt will not add the parens here, so what's the right solution? not to rewrite this case, keep |
I think it either needs to add the parenthesis, which I think should be the best solution, or at least do nothing. |
Maybe easiest would be to add parenthesis when infix apply is used? |
i don't think we have a way (yet) to add anything. we can remove or replace :) i had some code in the works a long time ago, but didn't finish it... |
Configuration (required)
Please paste the contents of your
.scalafmt.conf
file here:Steps
Given code like this:
Problem
Scalafmt formats code like this:
Expectation
I expect the code to compile.
The text was updated successfully, but these errors were encountered: