diff --git a/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/FormatOps.scala b/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/FormatOps.scala index e04a273044..5bdf7a6112 100644 --- a/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/FormatOps.scala +++ b/scalafmt-core/shared/src/main/scala/org/scalafmt/internal/FormatOps.scala @@ -1050,9 +1050,7 @@ class FormatOps( case _ => Right(style.newlines.fold) } val exclude = style.binPack.parentConstructors match { - case BinPack.ParentCtors.Always - if ft.noBreak || style.newlines.sourceIgnored => - insideBracesBlock(ft, lastToken, true) + case BinPack.ParentCtors.Always => insideBracesBlock(ft, lastToken, true) case _ => TokenRanges.empty } val noSyntaxNL = extendsThenWith diff --git a/scalafmt-tests/shared/src/test/resources/newlines/source_classic.stat b/scalafmt-tests/shared/src/test/resources/newlines/source_classic.stat index 6ab1b09a8a..0a8f437e87 100644 --- a/scalafmt-tests/shared/src/test/resources/newlines/source_classic.stat +++ b/scalafmt-tests/shared/src/test/resources/newlines/source_classic.stat @@ -9835,10 +9835,12 @@ trait FunctionInstances extends FunctionInstances0 { } } >>> -Idempotency violated -=> Diff (- obtained, + expected) - implicit def function6Instance[T1, T2, T3, T4, T5, -- T6]: Monad[(T1, T2, T3, T4, T5, T6) => *] with BindRec[(T1, T2, T3, T4, T5, T6) => *] = -+ T6]: Monad[(T1, T2, T3, T4, T5, T6) => *] -+ with BindRec[(T1, T2, T3, T4, T5, T6) => *] = - new Monad[(T1, T2, T3, T4, T5, T6) => *] +trait FunctionInstances extends FunctionInstances0 { + implicit def function6Instance[T1, T2, T3, T4, T5, + T6]: Monad[(T1, T2, T3, T4, T5, T6) => *] + with BindRec[(T1, T2, T3, T4, T5, T6) => *] = + new Monad[(T1, T2, T3, T4, T5, T6) => *] + with BindRec[(T1, T2, T3, T4, T5, T6) => *] { + // + } +} diff --git a/scalafmt-tests/shared/src/test/resources/newlines/source_keep.stat b/scalafmt-tests/shared/src/test/resources/newlines/source_keep.stat index 5fbedb222f..e30d2ad62b 100644 --- a/scalafmt-tests/shared/src/test/resources/newlines/source_keep.stat +++ b/scalafmt-tests/shared/src/test/resources/newlines/source_keep.stat @@ -9632,10 +9632,12 @@ trait FunctionInstances extends FunctionInstances0 { } } >>> -Idempotency violated -=> Diff (- obtained, + expected) - implicit def function6Instance[T1, T2, T3, T4, T5, -- T6]: Monad[(T1, T2, T3, T4, T5, T6) => *] with BindRec[(T1, T2, T3, T4, T5, T6) => *] = -+ T6]: Monad[(T1, T2, T3, T4, T5, T6) => *] -+ with BindRec[(T1, T2, T3, T4, T5, T6) => *] = - new Monad[(T1, T2, T3, T4, T5, T6) => *] +trait FunctionInstances extends FunctionInstances0 { + implicit def function6Instance[T1, T2, T3, T4, T5, + T6]: Monad[(T1, T2, T3, T4, T5, T6) => *] + with BindRec[(T1, T2, T3, T4, T5, T6) => *] = + new Monad[(T1, T2, T3, T4, T5, T6) => *] + with BindRec[(T1, T2, T3, T4, T5, T6) => *] { + // + } +}