File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
compat/src/main/scala-2.11_2.12/scala/collection/compat Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,12 @@ private[compat] trait PackageShared {
5555
5656 implicit def genericCompanionToCBF [A , CC [X ] <: GenTraversable [X ]](
5757 fact : GenericCompanion [CC ]): CanBuildFrom [Any , A , CC [A ]] = {
58- val builder : m.Builder [A , CC [A ]] = fact match {
58+ /* see https://github.com/scala/scala-library-compat/issues/337
59+ `simpleCBF.apply` takes a by-name parameter and relies on
60+ repeated references generating new builders, thus this expression
61+ must be non-strict
62+ */
63+ def builder : m.Builder [A , CC [A ]] = fact match {
5964 case c.Seq | i.Seq => new IdentityPreservingBuilder [A , i.Seq ](i.Seq .newBuilder[A ])
6065 case c.LinearSeq | i.LinearSeq =>
6166 new IdentityPreservingBuilder [A , i.LinearSeq ](i.LinearSeq .newBuilder[A ])
You can’t perform that action at this time.
0 commit comments