Skip to content

Commit

Permalink
FormatWriter: don't rewrite {} => () in assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Feb 17, 2020
1 parent 3062fc3 commit a055103
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class FormatWriter(formatOps: FormatOps) {
case f: Term.Function =>
TreeOps.getTermSingleStat(f.body).isDefined &&
!RedundantBraces.needParensAroundParams(f)
case _: Term.Assign => false // disallowed in 2.13
case _ => true
} =>
b.parent match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,13 @@ val a = b[IO](
{ c: Int => if (d) e else f }, g)
>>>
val a = b[IO]({ c: Int => if (d) e else f }, g)
<<< #1708 with an assignment block
F.runAsync(stream.compile.toVector) {
case Right(bs) => IO { bytes = bs }
case Left(t) => IO.raiseError(t)
}
>>>
F.runAsync(stream.compile.toVector) {
case Right(bs) => IO { bytes = bs }
case Left(t) => IO.raiseError(t)
}

0 comments on commit a055103

Please sign in to comment.