@@ -25,8 +25,6 @@ import scala.collection.mutable.{ArrayBuffer, StringBuilder}
2525import scala .language .implicitConversions
2626import scala .runtime .ScalaRunTime .nullForGC
2727
28- import Stream .cons
29-
3028@ deprecated(" Use LazyListIterable (which is fully lazy) instead of Stream (which has a lazy tail only)" , " 2.13.0" )
3129@ SerialVersionUID (3L )
3230sealed abstract class Stream [+ A ] extends AbstractSeq [A ]
@@ -123,11 +121,11 @@ sealed abstract class Stream[+A] extends AbstractSeq[A]
123121 * @return The stream containing elements of this stream and the iterable object.
124122 */
125123 def lazyAppendedAll [B >: A ](suffix : => collection.IterableOnce [B ]): Stream [B ] =
126- if (isEmpty) iterableFactory.from(suffix) else cons[B ](head, tail.lazyAppendedAll(suffix))
124+ if (isEmpty) iterableFactory.from(suffix) else Stream . cons[B ](head, tail.lazyAppendedAll(suffix))
127125
128126 override def scanLeft [B ](z : B )(op : (B , A ) => B ): Stream [B ] =
129127 if (isEmpty) z +: iterableFactory.empty
130- else cons(z, tail.scanLeft(op(z, head))(op))
128+ else Stream . cons(z, tail.scanLeft(op(z, head))(op))
131129
132130 /** Stream specialization of reduceLeft which allows GC to collect
133131 * along the way.
@@ -169,11 +167,11 @@ sealed abstract class Stream[+A] extends AbstractSeq[A]
169167 override final def withFilter (p : A => Boolean ): collection.WithFilter [A , Stream ] =
170168 Stream .withFilter(coll, p)
171169
172- override final def prepended [B >: A ](elem : B ): Stream [B ] = cons(elem, coll)
170+ override final def prepended [B >: A ](elem : B ): Stream [B ] = Stream . cons(elem, coll)
173171
174172 override final def map [B ](f : A => B ): Stream [B ] =
175173 if (isEmpty) iterableFactory.empty
176- else cons(f(head), tail.map(f))
174+ else Stream . cons(f(head), tail.map(f))
177175
178176 @ tailrec override final def collect [B ](pf : PartialFunction [A , B ]): Stream [B ] =
179177 if (isEmpty) Stream .empty
@@ -218,7 +216,7 @@ sealed abstract class Stream[+A] extends AbstractSeq[A]
218216 case that : collection.Iterable [B ] => that
219217 case _ => LazyList .from(that)
220218 }
221- cons[(A , B )]((this .head, thatIterable.head), this .tail.zip(thatIterable.tail))
219+ Stream . cons[(A , B )]((this .head, thatIterable.head), this .tail.zip(thatIterable.tail))
222220 }
223221
224222 override final def zipWithIndex : Stream [(A , Int )] = this .zip(LazyList .from(0 ))
0 commit comments