@@ -592,7 +592,7 @@ final class LazyListIterable[+A] private(@untrackedCaptures lazyState: () => Laz
592
592
*/
593
593
// optimisations are not for speed, but for functionality
594
594
// 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* } =
596
596
if (knownIsEmpty) LazyListIterable .empty
597
597
else LazyListIterable .flatMapImpl(this , f)
598
598
@@ -1061,11 +1061,11 @@ object LazyListIterable extends IterableFactory[LazyListIterable] {
1061
1061
}
1062
1062
}
1063
1063
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* } = {
1065
1065
// DO NOT REFERENCE `ll` ANYWHERE ELSE, OR IT WILL LEAK THE HEAD
1066
1066
var restRef : LazyListIterable [A ]^ {ll} = ll // restRef is captured by closure arg to newLL, so A is not recognized as parametric
1067
1067
newLL {
1068
- var it : Iterator [B ]^ {ll, f} = null
1068
+ var it : Iterator [B ]^ {ll, f* } = null
1069
1069
var itHasNext = false
1070
1070
var rest = restRef // var rest = restRef.elem
1071
1071
while (! itHasNext && ! rest.isEmpty) {
@@ -1307,7 +1307,7 @@ object LazyListIterable extends IterableFactory[LazyListIterable] {
1307
1307
extends collection.WithFilter [A , LazyListIterable ] {
1308
1308
private [this ] val filtered = lazyList.filter(p)
1309
1309
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)
1311
1311
def foreach [U ](f : A => U ): Unit = filtered.foreach(f)
1312
1312
def withFilter (q : A => Boolean ): collection.WithFilter [A , LazyListIterable ]^ {this , q} = new WithFilter (filtered, q)
1313
1313
}
0 commit comments