Skip to content

Commit 0c82590

Browse files
committed
Fix two CC errors in stdlib
They turns out not to be bugs. We cannot safely widen `{asIterable*}` to `{}` in these cases.
1 parent c53ec8a commit 0c82590

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scala2-library-cc/src/scala/collection/Iterable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ trait IterableOps[+A, +CC[_], +C] extends Any with IterableOnce[A] with Iterable
684684

685685
def flatMap[B](@caps.use f: A => IterableOnce[B]^): CC[B]^{this, f*} = iterableFactory.from(new View.FlatMap(this, f))
686686

687-
def flatten[B](implicit asIterable: A -> IterableOnce[B]): CC[B]^{this} = flatMap(asIterable)
687+
def flatten[B](implicit asIterable: A -> IterableOnce[B]): CC[B]^{this, asIterable*} = flatMap(asIterable)
688688

689689
def collect[B](pf: PartialFunction[A, B]^): CC[B]^{this, pf} =
690690
iterableFactory.from(new View.Collect(this, pf))

scala2-library-cc/src/scala/collection/immutable/LazyListIterable.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ final class LazyListIterable[+A] private(@untrackedCaptures lazyState: () => Laz
600600
*
601601
* $preservesLaziness
602602
*/
603-
override def flatten[B](implicit asIterable: A -> IterableOnce[B]): LazyListIterable[B]^{this} = flatMap(asIterable)
603+
override def flatten[B](implicit asIterable: A -> IterableOnce[B]): LazyListIterable[B]^{this, asIterable*} = flatMap(asIterable)
604604

605605
/** @inheritdoc
606606
*

0 commit comments

Comments
 (0)