You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reproducable via the repl (as long as -optimise isn't on of course).
valviewed:Iterable[Iterable[Iterable[Int]]] =List(List(List(0).view).view).view
valfiltered= viewed.flatMap{ x => x.flatMap( y =>List( y.filter{ _
>0 } ) ) }
filtered.iterator.toIterable.flatten
will throw the following exception and stack trace:
NoSuchElementException("next on empty iterator") from
at scala.collection.Iterator$$anon$2.next(Iterator.scala:38)
at scala.collection.Iterator$$anon$2.next(Iterator.scala:36)
at scala.collection.Iterator$$anon$14.next(Iterator.scala:394)
at scala.collection.IterableLike$class.head(IterableLike.scala:91)
at scala.collection.SeqViewLike$AbstractTransformed.head(SeqViewLike.scala:43)
at scala.collection.immutable.Stream.scala$collection$immutable$Stream$$flatten1$1(Stream.scala:909)
at scala.collection.immutable.Stream.flatten(Stream.scala:914)
at scala.collection.immutable.Stream.flatten(Stream.scala:185)
Drop the innermost view and it won't and you'll get the
correct Stream() as the result. Using Nil.view will work, using
List(1 ...) will work, anything as long as the first predicate to
Iterator.filter works.
The text was updated successfully, but these errors were encountered:
affects 2.10.0 M7.
Reproducable via the repl (as long as -optimise isn't on of course).
will throw the following exception and stack trace:
Drop the innermost view and it won't and you'll get the
correct Stream() as the result. Using Nil.view will work, using
List(1 ...) will work, anything as long as the first predicate to
Iterator.filter works.
The text was updated successfully, but these errors were encountered: