Fixed #1709 - .to(Collector) syntax fix for 2.12 #1725
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
.to
was overloaded -- one took theCollector
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 itprivate[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 ass.compile.to(C)
b/cCollector
can be implicitly instantiated from anyFactory
. Only case where that's not true is whenC
doesn't implementFactory
directly and instead, there's some implicit factory in scope.