Skip to content

Fix bincompat of PartiallyAppliedFromIterator on Scala 2.12#2940

Merged
mpilquist merged 4 commits intotypelevel:mainfrom
armanbilge:issue/2939
Jul 8, 2022
Merged

Fix bincompat of PartiallyAppliedFromIterator on Scala 2.12#2940
mpilquist merged 4 commits intotypelevel:mainfrom
armanbilge:issue/2939

Conversation

@armanbilge
Copy link
Copy Markdown
Member

Fixes #2939.

This was my fault due to changes in #2933.

Inline comments below.

new PartiallyAppliedFromEither(dummy = true)

private[fs2] final class PartiallyAppliedFromIterator[F[_]](
final class PartiallyAppliedFromIterator[F[_]](
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this class was package-private, so we received no bincompat support from MiMa. Indeed, the fact that this works at all seems like a manifestation of scala/bug#6794.

Comment on lines +3321 to +3330
object PartiallyAppliedFromIterator {
@deprecated("bincompat", "3.2.10")
private[fs2] def `apply$extension`[F[_], A](
dummy: Boolean,
iterator: Iterator[A],
chunkSize: Int,
F: Sync[F]
): Stream[F, A] =
new PartiallyAppliedFromIterator(dummy).apply(iterator, chunkSize)(F)
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Scala 2.12, adding an overload of a method defined on an AnyVal causes the the binary name of the original method to change, breaking bincompat. Fortunately, we can restore a method with the same signature manually.

@armanbilge
Copy link
Copy Markdown
Member Author

Bla, this became a bit messy 😕

@mpilquist mpilquist merged commit cb507e6 into typelevel:main Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Possible binary compability problem on fs2-3.2.9 on Scala 2.12

2 participants