Skip to content

Commit 77cdc43

Browse files
committed
remove imports to deprecated elements
1 parent af3df77 commit 77cdc43

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

library/src/scala/collection/convert/ImplicitConversions.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ import language.experimental.captureChecking
2020
import java.util.{concurrent => juc}
2121
import java.{lang => jl, util => ju}
2222

23-
import scala.collection.JavaConverters._
2423
import scala.language.implicitConversions
2524

2625
/** Defines implicit converter methods from Java to Scala collections. */
2726
@deprecated("Use `scala.jdk.CollectionConverters` instead", "2.13.0")
2827
trait ToScalaImplicits {
28+
import scala.collection.JavaConverters.*
29+
2930
/** Implicitly converts a Java `Iterator` to a Scala `Iterator`.
3031
* @see [[JavaConverters.asScalaIterator]]
3132
*/
@@ -80,6 +81,7 @@ trait ToScalaImplicits {
8081
/** Defines implicit conversions from Scala to Java collections. */
8182
@deprecated("Use `scala.jdk.CollectionConverters` instead", "2.13.0")
8283
trait ToJavaImplicits {
84+
import scala.collection.JavaConverters.*
8385
/** Implicitly converts a Scala `Iterator` to a Java `Iterator`.
8486
* @see [[JavaConverters.asJavaIterator]]
8587
*/

library/src/scala/collection/immutable/Stream.scala

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import scala.collection.mutable.{ArrayBuffer, StringBuilder}
2525
import scala.language.implicitConversions
2626
import 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)
3230
sealed 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))

library/src/scala/runtime/ScalaNumberProxy.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@ import scala.language.`2.13`
1717
import scala.collection.immutable
1818
import scala.math.ScalaNumericAnyConversions
1919
import immutable.NumericRange
20-
import Proxy.Typed
2120
import scala.annotation.nowarn
2221

2322
/** Base classes for the Rich* wrappers of the primitive types.
2423
* As with all classes in scala.runtime.*, this is not a supported API.
2524
*/
2625
@nowarn("cat=deprecation")
27-
trait ScalaNumberProxy[T] extends Any with ScalaNumericAnyConversions with Typed[T] with OrderedProxy[T] {
26+
trait ScalaNumberProxy[T] extends Any with ScalaNumericAnyConversions with Proxy.Typed[T] with OrderedProxy[T] {
2827
protected implicit def num: Numeric[T]
2928

3029
def doubleValue = num.toDouble(self)
@@ -70,14 +69,14 @@ trait FractionalProxy[T] extends Any with ScalaNumberProxy[T] {
7069
}
7170

7271
@nowarn("cat=deprecation")
73-
trait OrderedProxy[T] extends Any with Ordered[T] with Typed[T] {
72+
trait OrderedProxy[T] extends Any with Ordered[T] with Proxy.Typed[T] {
7473
protected def ord: Ordering[T]
7574

7675
def compare(y: T) = ord.compare(self, y)
7776
}
7877

7978
@nowarn("cat=deprecation")
80-
trait RangedProxy[T] extends Any with Typed[T] {
79+
trait RangedProxy[T] extends Any with Proxy.Typed[T] {
8180
type ResultWithoutStep
8281

8382
def until(end: T): ResultWithoutStep

0 commit comments

Comments
 (0)