Skip to content

Commit

Permalink
FormatOps: ignore source NL in binpacking ctors
Browse files Browse the repository at this point in the history
Otherwise, leads to non-idempotent formatting.
  • Loading branch information
kitbellew committed Oct 2, 2024
1 parent f6bff68 commit 5629a84
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => *] {
//
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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) => *] {
//
}
}

0 comments on commit 5629a84

Please sign in to comment.