@@ -592,7 +592,7 @@ final class LazyListIterable[+A] private(@untrackedCaptures lazyState: () => Laz
592592 */
593593 // optimisations are not for speed, but for functionality
594594 // see tickets #153, #498, #2147, and corresponding tests in run/ (as well as run/stream_flatmap_odds.scala)
595- override def flatMap [B ](@ caps.use f : A => IterableOnce [B ]^ ): LazyListIterable [B ]^ {this , f} =
595+ override def flatMap [B ](@ caps.use f : A => IterableOnce [B ]^ ): LazyListIterable [B ]^ {this , f* } =
596596 if (knownIsEmpty) LazyListIterable .empty
597597 else LazyListIterable .flatMapImpl(this , f)
598598
@@ -1061,11 +1061,11 @@ object LazyListIterable extends IterableFactory[LazyListIterable] {
10611061 }
10621062 }
10631063
1064- private def flatMapImpl [A , B ](ll : LazyListIterable [A ]^ , f : A => IterableOnce [B ]^ ): LazyListIterable [B ]^ {ll, f} = {
1064+ private def flatMapImpl [A , B ](ll : LazyListIterable [A ]^ , f : A => IterableOnce [B ]^ ): LazyListIterable [B ]^ {ll, f* } = {
10651065 // DO NOT REFERENCE `ll` ANYWHERE ELSE, OR IT WILL LEAK THE HEAD
10661066 var restRef : LazyListIterable [A ]^ {ll} = ll // restRef is captured by closure arg to newLL, so A is not recognized as parametric
10671067 newLL {
1068- var it : Iterator [B ]^ {ll, f} = null
1068+ var it : Iterator [B ]^ {ll, f* } = null
10691069 var itHasNext = false
10701070 var rest = restRef // var rest = restRef.elem
10711071 while (! itHasNext && ! rest.isEmpty) {
@@ -1307,7 +1307,7 @@ object LazyListIterable extends IterableFactory[LazyListIterable] {
13071307 extends collection.WithFilter [A , LazyListIterable ] {
13081308 private [this ] val filtered = lazyList.filter(p)
13091309 def map [B ](f : A => B ): LazyListIterable [B ]^ {this , f} = filtered.map(f)
1310- def flatMap [B ](@ caps.use f : A => IterableOnce [B ]^ ): LazyListIterable [B ]^ {this , f} = filtered.flatMap(f)
1310+ def flatMap [B ](@ caps.use f : A => IterableOnce [B ]^ ): LazyListIterable [B ]^ {this , f* } = filtered.flatMap(f)
13111311 def foreach [U ](f : A => U ): Unit = filtered.foreach(f)
13121312 def withFilter (q : A => Boolean ): collection.WithFilter [A , LazyListIterable ]^ {this , q} = new WithFilter (filtered, q)
13131313 }
0 commit comments