Skip to content

Commit af23366

Browse files
committed
Make OneAndBinCompat0 sealed and make use of self-type annotation
in response to - #4739 (comment) - #4739 (comment)
1 parent c2d1444 commit af23366

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

core/src/main/scala/cats/data/OneAnd.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,7 @@ final case class OneAnd[F[_], A](head: A, tail: F[A]) extends OneAndBinCompat0[F
123123
s"OneAnd(${A.show(head)}, ${FA.show(tail)})"
124124
}
125125

126-
private[data] trait OneAndBinCompat0[F[_], A] {
127-
val head: A
128-
val tail: F[A]
129-
126+
sealed private[data] trait OneAndBinCompat0[F[_], A] { self: OneAnd[F, A] =>
130127
@deprecated("Kept for binary compatibility", "2.14.0")
131128
private[data] def unwrap(implicit F: Alternative[F]): F[A] =
132129
F.prependK(head, tail)

0 commit comments

Comments
 (0)