diff options
author | Martin Odersky <odersky@gmail.com> | 2009-02-13 11:59:49 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2009-02-13 11:59:49 +0000 |
commit | 04840e2ed4530df9a5ca59b984bf2b37a976dc70 (patch) | |
tree | 61394762e202f8ab60e0d3a8e8ac688404241bc3 /src/library/scalax/collection/immutable/List.scala | |
parent | 708baf94764e2a839e24ca6204060a8d0664d88c (diff) | |
download | scala-04840e2ed4530df9a5ca59b984bf2b37a976dc70.tar.gz scala-04840e2ed4530df9a5ca59b984bf2b37a976dc70.tar.bz2 scala-04840e2ed4530df9a5ca59b984bf2b37a976dc70.zip |
new version of collection libraries
Diffstat (limited to 'src/library/scalax/collection/immutable/List.scala')
-rw-r--r-- | src/library/scalax/collection/immutable/List.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/library/scalax/collection/immutable/List.scala b/src/library/scalax/collection/immutable/List.scala index 6851fb9769..cb5965a18a 100644 --- a/src/library/scalax/collection/immutable/List.scala +++ b/src/library/scalax/collection/immutable/List.scala @@ -12,7 +12,8 @@ package scalax.collection.immutable import mutable.ListBuffer -import generic.covariant.{SequenceTemplate, SequenceFactory} +import generic.{SequenceTemplate, SequenceFactory, EmptyIterableFactory, Builder} +import annotation.unchecked.uncheckedVariance /** A class representing an ordered collection of elements of type * <code>a</code>. This class comes with two implementing case @@ -23,7 +24,9 @@ import generic.covariant.{SequenceTemplate, SequenceFactory} * @author Martin Odersky and others * @version 2.8 */ -sealed abstract class List[+A] extends Stream[A] with SequenceTemplate[List, A] with Product { +sealed abstract class List[+A] extends Stream[A] + with SequenceTemplate[List, A @uncheckedVariance] + with Product { import collection.{Iterable, OrderedIterable, Sequence, Vector} @@ -572,7 +575,7 @@ final case class ::[B](private var hd: B, private[scalax] var tl: List[B]) exten * @author Martin Odersky and others * @version 1.0, 15/07/2003 */ -object List extends SequenceFactory[List] { +object List extends SequenceFactory[List] with EmptyIterableFactory[List] { override val empty: List[Nothing] = Nil @@ -721,7 +724,7 @@ object List extends SequenceFactory[List] { * in the same order * @deprecated use `array.toList` instead */ - def fromArray[A](arr: Array[A]): List[A] = fromArray(arr, 0, arr.length) + @deprecated def fromArray[A](arr: Array[A]): List[A] = fromArray(arr, 0, arr.length) /** Converts a range of an array into a list. * |