diff options
-rw-r--r-- | src/library/scala/collection/TraversableViewLike.scala | 2 | ||||
-rw-r--r-- | test/files/run/t5201.check | 1 | ||||
-rw-r--r-- | test/files/run/t5201.scala | 5 |
3 files changed, 8 insertions, 0 deletions
diff --git a/src/library/scala/collection/TraversableViewLike.scala b/src/library/scala/collection/TraversableViewLike.scala index 5ca038fd2e..eb2091a5f3 100644 --- a/src/library/scala/collection/TraversableViewLike.scala +++ b/src/library/scala/collection/TraversableViewLike.scala @@ -162,6 +162,8 @@ trait TraversableViewLike[+A, // if (b.isInstanceOf[NoBuilder[_]]) newFlatMapped(f).asInstanceOf[That] // else super.flatMap[B, That](f)(bf) } + override def flatten[B](implicit asTraversable: A => /*<:<!!!*/ GenTraversableOnce[B]) = + newFlatMapped(asTraversable) private[this] implicit def asThis(xs: Transformed[A]): This = xs.asInstanceOf[This] /** Boilerplate method, to override in each subclass diff --git a/test/files/run/t5201.check b/test/files/run/t5201.check new file mode 100644 index 0000000000..27ba77ddaf --- /dev/null +++ b/test/files/run/t5201.check @@ -0,0 +1 @@ +true diff --git a/test/files/run/t5201.scala b/test/files/run/t5201.scala new file mode 100644 index 0000000000..a371082797 --- /dev/null +++ b/test/files/run/t5201.scala @@ -0,0 +1,5 @@ +object Test extends App { + val seq = Seq(Seq(1, 2), Seq(3, 4)).view.flatten + + Console.println(seq.isInstanceOf[collection.SeqView[_,_]]) +} |