-
Notifications
You must be signed in to change notification settings - Fork 277
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
Scalafmt Rewrite Is Not Value Preserving #1756
Comments
@adamgfraser could you explain the title of this issue, please? does it mean that the current formatting doesn't result in equivalent scala? |
@kitbellew Sure, sorry. The original code is valid code that compiles. The rewritten code does not compile. The assignment syntax is only valid within a block. |
@adamgfraser ah, thank you. a similar problem (#1718) was fixed in #1715 and released in 2.4.2. when i run your test on 2.4.2, it produces
are you certain you are experiencing it with 2.4.2 and not an earlier version? |
@kitbellew Very certain. We encountered it just after merging a PR to update to 2.4.2. |
This template is a guideline, not a strict requirement.
Steps
Given code like this:
When I run scalafmt like this:
Problem
Scalafmt formats code like this:
Expectation
I would like the formatted output to look like this:
The text was updated successfully, but these errors were encountered: