Description
Iterator.continually(1).toIterable
seems to be lazily evaluated in Scala 2.12, but eagerly in Scala 2.13.
reproduction steps
With 2.12 the following returns an Iterable[Int]
backed by Stream
scala> Iterator.continually(1).toIterable
res0: Iterable[Int] = Stream(1, ?)
problem
With 2.13.3 the iterator seems to get evaluated eagerly:
scala> Iterator.continually(1).toIterable
^
warning: method toIterable in class IterableOnceExtensionMethods is deprecated (since 2.13.0): Use .iterator.to(Iterable)
// evaluation keeps running
the same result with the following except without the compiler warning
scala> Iterator.continually(1).to(Iterable)
// evaluation keeps running
I'd expect similar behaviour as with Scala 2.12.