Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #1709 - .to(Collector) syntax fix for 2.12 #1725

Merged
merged 4 commits into from
Jan 4, 2020

Conversation

mpilquist
Copy link
Member

@mpilquist mpilquist commented Jan 3, 2020

.to was overloaded -- one took the Collector and the other took an implicit factory. When the target type was known, the 2.12 compiler was picking the factory overload. To fix, I removed the old overload -- or rather, made it private[Stream] so that it cannot be called but it stays around for binary compatibility reasons.

Note that in practice, any s.compile.to[C] can be written as s.compile.to(C) b/c Collector can be implicitly instantiated from any Factory. Only case where that's not true is when C doesn't implement Factory directly and instead, there's some implicit factory in scope.

* Applies the given sink to this stream.
*/
@deprecated("Use .through instead", "1.0.2")
private[fs2] def to[F2[x] >: F[x]](f: Stream[F, O] => Stream[F2, Unit]): Stream[F2, Unit] =
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the reason for the mima exclusion. Not related to #1709 but noticed we can remove this safely now.

Copy link

@pauljamescleary pauljamescleary left a comment

Choose a reason for hiding this comment

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

Looks like Collector and Balance may have some scaladoc that uses the .to[A] syntax.

@mpilquist mpilquist merged commit 0a9cc37 into typelevel:master Jan 4, 2020
@mpilquist mpilquist added this to the 2.2.0 milestone Jan 18, 2020
@mpilquist mpilquist deleted the bugfix/1709 branch February 18, 2020 12:56
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.

2 participants