-
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
2.4.0: scalafmtAll failing to run on code that compiles #1708
Comments
We can't rewrite a lambda unless it has parens around parameters or one simple parameter without a type. Fixes scalameta#1707. Fixes scalameta#1708.
We can't rewrite a lambda unless it has parens around parameters or one simple parameter without a type. Fixes scalameta#1707. Fixes scalameta#1708.
@rossabaker please try v2.4.1 |
Thanks! It fixes the crash, but the result still doesn't compile. It's turning assignment into a named argument. I think that's a separate bug, which I can file if you'd like. The essence is this: var bytes: Vector[Byte] = null
val readBytes = IO(bytes)
F.runAsync(stream.compile.toVector) {
- case Right(bs) => IO { bytes = bs }
+ case Right(bs) => IO(bytes = bs)
case Left(t) => IO.raiseError(t)
} turns into
|
Would it be possible to have scalafmt respect the |
it only does this if RedundantBraces rewrite is enabled. @regadas |
Oh I see! thanks for pointing that out! However i believe that in this specific case Should we come up with a different rule? |
@regadas i don't mind but that requires input from the repo maintainers, such as @olafurpg @tanishiking @poslegm who have been quite conservative about introducing new options. |
@kitbellew awesome! 🎉 Thanks! |
This template is a guideline, not a strict requirement.
Steps
Given code like this
When I run scalafmt like this:
Problem
Scalafmt fails like this:
Expectation
Can successfully run
scalafmtAll
on any source tree that compiles.Workaround
Stay on 2.3 for the moment. 😄
Notes
Also happens on the
ember-client
project:scalafmtAll
runs on other modules on this commit, but the output fails to compile (report).The text was updated successfully, but these errors were encountered: