summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2005-03-21 16:59:33 +0000
committermihaylov <mihaylov@epfl.ch>2005-03-21 16:59:33 +0000
commitf0e63b8bcbc9ff6be4fe6d372ffa324f4ab3adf9 (patch)
tree8fe187425552ab4559f9eba97a79057f5b769884
parentb2ee76bdc5e00b25c42c84a85f268f0d656fb064 (diff)
downloadscala-f0e63b8bcbc9ff6be4fe6d372ffa324f4ab3adf9.tar.gz
scala-f0e63b8bcbc9ff6be4fe6d372ffa324f4ab3adf9.tar.bz2
scala-f0e63b8bcbc9ff6be4fe6d372ffa324f4ab3adf9.zip
Added a toList method to override the one from ...
Added a toList method to override the one from scala.Seq
-rw-r--r--sources/scala/List.scala6
-rw-r--r--test/files/dis/List.check1
2 files changed, 7 insertions, 0 deletions
diff --git a/sources/scala/List.scala b/sources/scala/List.scala
index a774787e51..0563f49998 100644
--- a/sources/scala/List.scala
+++ b/sources/scala/List.scala
@@ -363,6 +363,12 @@ sealed trait List[+a] extends Seq[a] {
};
};
+ /** Transform this sequence into a list of all elements.
+ *
+ * @return a list which enumerates all elements of this sequence.
+ */
+ override def toList = this;
+
/** Returns the list without its last element.
*
* @return the list without its last element.
diff --git a/test/files/dis/List.check b/test/files/dis/List.check
index 7da3b40160..5b006f1764 100644
--- a/test/files/dis/List.check
+++ b/test/files/dis/List.check
@@ -8,6 +8,7 @@ sealed trait List[+a]() extends scala.Seq[a] with scala.ScalaObject {
def length: scala.Int;
def indices: scala.List[scala.Int];
def elements: scala.Iterator[a];
+ override def toList: scala.List[a];
def init: scala.List[a];
def last: a;
override def take(scala.Int): scala.List[a];