summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-04-10 15:53:35 +0000
committermichelou <michelou@epfl.ch>2007-04-10 15:53:35 +0000
commit10cbf9df8d32e7e2af44ef412239e21824fdaec3 (patch)
treed2ef67c5185931ab4251cd893e197e8c02c69a6a
parent1f2b7055e45dc6dff6540f611cd5a631ea3e1fdb (diff)
downloadscala-10cbf9df8d32e7e2af44ef412239e21824fdaec3.tar.gz
scala-10cbf9df8d32e7e2af44ef412239e21824fdaec3.tar.bz2
scala-10cbf9df8d32e7e2af44ef412239e21824fdaec3.zip
added options to scaladoc Ant task
removed several unchecked warnings
-rw-r--r--build.xml28
-rw-r--r--lib/scala-compiler.jar.desired.sha12
-rw-r--r--lib/scala-library.jar.desired.sha12
-rw-r--r--src/library/scala/collection/SortedSet.scala2
-rw-r--r--src/library/scala/collection/jcl/Set.scala49
-rw-r--r--test/files/jvm5/annotations.check2
-rw-r--r--test/files/jvm5/annotations.scala7
-rw-r--r--test/files/run/regularpatmatnew.scala111
8 files changed, 108 insertions, 95 deletions
diff --git a/build.xml b/build.xml
index c4f13052df..393998c465 100644
--- a/build.xml
+++ b/build.xml
@@ -320,13 +320,13 @@ BUILD LOCAL REFERENCE (LOCKER) LAYER
<starr
srcdir="${src.dir}/library"
destdir="${locker.dir}/lib/library"
- usepredefs="no" deprecation="yes"
+ usepredefs="no" deprecation="yes" unchecked="yes"
classpath="${locker.dir}/lib/library"
includes="scala/Predef.scala"/>
<starr
srcdir="${src.dir}/library"
destdir="${locker.dir}/lib/library"
- deprecation="yes"
+ deprecation="yes" unchecked="yes"
classpath="${locker.dir}/lib/library">
<include name="**/*.scala"/>
<exclude name="scala/Predef.scala"/>
@@ -339,7 +339,7 @@ BUILD LOCAL REFERENCE (LOCKER) LAYER
<starr
srcdir="${src.dir}/compiler"
destdir="${locker.dir}/lib/compiler"
- deprecation="yes">
+ deprecation="yes" unchecked="yes">
<classpath>
<pathelement location="${locker.dir}/lib/library"/>
<pathelement location="${locker.dir}/lib/compiler"/>
@@ -434,14 +434,16 @@ BUILD QUICK-TEST LAYER
<locker
srcdir="${src.dir}/library"
destdir="${quick.dir}/lib/library"
- usepredefs="no" addparams="${nsc.params}" deprecation="yes"
+ usepredefs="no" addparams="${nsc.params}"
+ deprecation="yes" unchecked="yes"
scalacdebugging="${nsc.log-files}"
classpath="${quick.dir}/lib/library"
includes="scala/Predef.scala"/>
<locker
srcdir="${src.dir}/library"
destdir="${quick.dir}/lib/library"
- addparams="${nsc.params}" deprecation="yes"
+ addparams="${nsc.params}"
+ deprecation="yes" unchecked="yes"
scalacdebugging="${nsc.log-files}"
classpath="${quick.dir}/lib/library">
<include name="**/*.scala"/>
@@ -455,7 +457,8 @@ BUILD QUICK-TEST LAYER
<locker
srcdir="${src.dir}/dbc"
destdir="${quick.dir}/lib/dbc"
- addparams="${nsc.params}" deprecation="yes"
+ addparams="${nsc.params}"
+ deprecation="yes" unchecked="yes"
scalacdebugging="${nsc.log-files}">
<classpath>
<pathelement location="${quick.dir}/lib/library"/>
@@ -475,7 +478,8 @@ BUILD QUICK-TEST LAYER
<locker
srcdir="${src.dir}/actors"
destdir="${quick.dir}/lib/actors"
- addparams="${nsc.params}" deprecation="yes"
+ addparams="${nsc.params}"
+ deprecation="yes" unchecked="yes"
scalacdebugging="${nsc.log-files}">
<classpath>
<pathelement location="${quick.dir}/lib/library"/>
@@ -634,13 +638,15 @@ TEST
<quick
srcdir="${src.dir}/library"
destdir="${strap.dir}/lib/library"
- usepredefs="no" addparams="${nsc.params}" deprecation="yes"
+ usepredefs="no" addparams="${nsc.params}"
+ deprecation="yes" unchecked="yes"
classpath="${strap.dir}/lib/library"
includes="scala/Predef.scala"/>
<quick
srcdir="${src.dir}/library"
destdir="${strap.dir}/lib/library"
- addparams="${nsc.params}" deprecation="yes"
+ addparams="${nsc.params}"
+ deprecation="yes" unchecked="yes"
classpath="${strap.dir}/lib/library">
<include name="**/*.scala"/>
<exclude name="scala/Predef.scala"/>
@@ -653,7 +659,8 @@ TEST
<quick
srcdir="${src.dir}/dbc"
destdir="${strap.dir}/lib/dbc"
- addparams="${nsc.params}" deprecation="yes">
+ addparams="${nsc.params}"
+ deprecation="yes" unchecked="yes">
<classpath>
<pathelement location="${strap.dir}/lib/library"/>
<pathelement location="${strap.dir}/lib/dbc"/>
@@ -804,6 +811,7 @@ DOCUMENTATION
srcdir="${src.dir}"
destdir="${api-lib.dir}"
sourcepath=""
+ deprecation="yes" unchecked="yes"
windowtitle="Scala Library Documentation"
documenttitle="&lt;div&gt;Scala ${version.number}&lt;/div&gt;"
classpath="${quick.dir}/lib/library${path.separator}${quick.dir}/lib/actors">
diff --git a/lib/scala-compiler.jar.desired.sha1 b/lib/scala-compiler.jar.desired.sha1
index f2e17f4b4e..77e941fd2d 100644
--- a/lib/scala-compiler.jar.desired.sha1
+++ b/lib/scala-compiler.jar.desired.sha1
@@ -1 +1 @@
-7c948efcd4c5657d565995f6718bddc97017dbf6 ?scala-compiler.jar
+3026b85a4a4b9ebe56c6dad476f6413d9e3a25a4 ?scala-compiler.jar
diff --git a/lib/scala-library.jar.desired.sha1 b/lib/scala-library.jar.desired.sha1
index f5c84dfd86..92750dd3eb 100644
--- a/lib/scala-library.jar.desired.sha1
+++ b/lib/scala-library.jar.desired.sha1
@@ -1 +1 @@
-90a2cbf4596a76329fe38d5e612e30ba7dc63761 ?scala-library.jar
+a6e92e07e2ebd57f0044867393e470e6c7072867 ?scala-library.jar
diff --git a/src/library/scala/collection/SortedSet.scala b/src/library/scala/collection/SortedSet.scala
index 8e605a61ce..058876c974 100644
--- a/src/library/scala/collection/SortedSet.scala
+++ b/src/library/scala/collection/SortedSet.scala
@@ -41,7 +41,7 @@ trait SortedSet[A] extends Set[A] with Sorted[A, A] {
override def range(from: A, until: A) = rangeImpl(Some(from),Some(until))
override def subsetOf(that: Set[A]): Boolean = that match {
- case that: SortedSet[A] => that.hasAll(elements)
+ case that: SortedSet[_] => that.hasAll(elements)
case that => super.subsetOf(that)
}
diff --git a/src/library/scala/collection/jcl/Set.scala b/src/library/scala/collection/jcl/Set.scala
index bed84a8462..975b76a167 100644
--- a/src/library/scala/collection/jcl/Set.scala
+++ b/src/library/scala/collection/jcl/Set.scala
@@ -1,14 +1,14 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2006-2007, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
+** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
\* */
// $Id$
-package scala.collection.jcl;
+package scala.collection.jcl
/** Analogous to a Java set.
*
@@ -17,37 +17,38 @@ package scala.collection.jcl;
trait Set[A] extends Collection[A] with scala.collection.mutable.Set[A] {
/** Add will return false if "a" already exists in the set. **/
- override def add(a : A) : Boolean;
-
- override def ++(i : Iterable[A]) : this.type = super[Collection].++(i);
- override def --(i : Iterable[A]) : this.type = super[Collection].--(i);
- override def +(t : A) : this.type = super[Collection].+(t);
- override def -(t : A) : this.type = super[Collection].-(t);
- override def retain(f : A => Boolean) = super[Collection].retain(f);
- override def isEmpty = super[Collection].isEmpty;
- override final def contains(a : A) = has(a);
- override def clear() = super.clear();
+ override def add(a: A): Boolean
+
+ override def ++(i: Iterable[A]) : this.type = super[Collection].++(i)
+ override def --(i: Iterable[A]) : this.type = super[Collection].--(i)
+ override def +(t: A) : this.type = super[Collection].+(t)
+ override def -(t: A) : this.type = super[Collection].-(t)
+ override def retain(f: A => Boolean) = super[Collection].retain(f)
+ override def isEmpty = super[Collection].isEmpty
+ override final def contains(a: A) = has(a)
+ override def clear() = super.clear()
override def subsetOf(set : scala.collection.Set[A]) = set match {
- case set : Set[A] => set.hasAll(this);
- case set => super.subsetOf(set);
+ case set : Set[_] => set.hasAll(this)
+ case set => super.subsetOf(set)
}
- override def transform(f : A => A) = {
- var toAdd : List[A] = Nil;
- val i = elements;
+ override def transform(f: A => A) = {
+ var toAdd : List[A] = Nil
+ val i = elements
while (i.hasNext) {
- val i0 = i.next;
- val i1 = f(i0);
+ val i0 = i.next
+ val i1 = f(i0)
if (i0 != i1) {
- i.remove; toAdd = i1 :: toAdd;
+ i.remove; toAdd = i1 :: toAdd
}
}
- addAll(toAdd);
+ addAll(toAdd)
}
- override def pfilter(p : A => Boolean) : Set[A] = new Filter(p);
- class Filter(p : A => Boolean) extends super.Filter(p) with Set[A] {
- override def filter(p : A => Boolean): scala.collection.mutable.Set[A] = {
+ override def pfilter(p: A => Boolean): Set[A] = new Filter(p)
+
+ class Filter(p: A => Boolean) extends super.Filter(p) with Set[A] {
+ override def filter(p: A => Boolean): scala.collection.mutable.Set[A] = {
super[Set].retain(p)
this
}
diff --git a/test/files/jvm5/annotations.check b/test/files/jvm5/annotations.check
index efdd54a237..a4e3d7420b 100644
--- a/test/files/jvm5/annotations.check
+++ b/test/files/jvm5/annotations.check
@@ -1,7 +1,7 @@
class java.rmi.RemoteException
class java.io.IOException
@java.lang.Deprecated()
-@test.SourceAnnotation(mail=scala@lists.epfl.ch, value=http://scala.epfl.ch)
+@test.SourceAnnotation(mail=scala@lists.epfl.ch, value=http://scala-lang.org)
@test.SourceAnnotation(mail=you@bloodsuckers.com, value=http://bloodsuckers.com)
@test.SourceAnnotation(mail=bill.gates@bloodsuckers.com, value=http://bloodsuckers.com)
0
diff --git a/test/files/jvm5/annotations.scala b/test/files/jvm5/annotations.scala
index e81aa863a8..a58921adef 100644
--- a/test/files/jvm5/annotations.scala
+++ b/test/files/jvm5/annotations.scala
@@ -1,5 +1,3 @@
-import java.lang.Deprecated
-
object Test1 {
class Foo {
@remote
@@ -37,6 +35,7 @@ public class Main {
}
*/
object Test3 {
+ import java.lang.Deprecated
class Foo {
@Deprecated
def foo: Unit = ()
@@ -62,13 +61,13 @@ public class Main {
Annotation[] annotations = clazz.getAnnotations();
for (int i = 0; i < annotations.length; i++)
System.out.println(annotations[i]);
- // @test.Main$Source(url=http://scala.epfl.ch, mail=scala@lists.epfl.ch)
+ // @test.Main$Source(url=http://scala-lang.org, mail=scala@lists.epfl.ch)
}
}
*/
object Test4 {
import test.SourceAnnotation // defined in SourceAnnotation.java
- @SourceAnnotation{val value = "http://scala.epfl.ch", val mail = "scala@lists.epfl.ch"}
+ @SourceAnnotation{val value = "http://scala-lang.org", val mail = "scala@lists.epfl.ch"}
class Foo1
@SourceAnnotation("http://bloodsuckers.com") { val mail = "you@bloodsuckers.com" }
class Foo2
diff --git a/test/files/run/regularpatmatnew.scala b/test/files/run/regularpatmatnew.scala
index a3401b2b7e..0457cd6d6c 100644
--- a/test/files/run/regularpatmatnew.scala
+++ b/test/files/run/regularpatmatnew.scala
@@ -1,7 +1,7 @@
object Test {
import scala.testing.SUnit._
- def main(args:Array[String]): Unit = {
+ def main(args: Array[String]) {
val tr = new TestResult
new TestSuite(
@@ -11,23 +11,23 @@ object Test {
new Test04,
new Test05,
new Test06,
- new Test07
+ new Test07,
+ new Test08
).run(tr)
- for(val f <- tr.failures())
- Console println f
+ for (val f <- tr.failures()) println(f)
}
class Test01 extends TestCase("uno (all ignoring patterns on List)") {
- def doMatch(l:List[String]):String = l match {
- case List(_*) => "ok"
+ def doMatch(xs: List[String]): String = xs match {
+ case List(_*) => "ok"
}
- override def runTest() = {
- val list1 = List();
- assertEquals(doMatch(list1), "ok");
- val list2 = List("1","2","3");
- assertEquals(doMatch(list2), "ok");
+ override def runTest() {
+ val list1 = List()
+ assertEquals(doMatch(list1), "ok")
+ val list2 = List("1","2","3")
+ assertEquals(doMatch(list2), "ok")
}
}
@@ -45,33 +45,33 @@ object Test {
*/
class Test02 extends TestCase("due (all ignoring patterns on Seq)") {
- def doMatch(l:Seq[String]):String = l match {
- case Seq(_*) => "ok"
+ def doMatch(l: Seq[String]): String = l match {
+ case Seq(_*) => "ok"
}
- override def runTest() = {
- val list1 = List();
- assertEquals(doMatch(list1), "ok");
- val list2 = List("1","2","3");
- assertEquals(doMatch(list2), "ok");
- val array3 = Array[String]();
- assertEquals(doMatch(array3), "ok");
- val array4 = Array[String]("ga","gu");
- assertEquals(doMatch(array4), "ok");
+ override def runTest() {
+ val list1 = List()
+ assertEquals(doMatch(list1), "ok")
+ val list2 = List("1", "2", "3")
+ assertEquals(doMatch(list2), "ok")
+ val array3 = Array[String]()
+ assertEquals(doMatch(array3), "ok")
+ val array4 = Array[String]("ga", "gu")
+ assertEquals(doMatch(array4), "ok")
}
}
class Test03 extends TestCase("tre (right-ignoring patterns on List, defaults)") {
- def doMatch(l:List[String]):String = l match {
- case List(_,_,_,_*) => "ok"
- case _ => "not ok"
+ def doMatch(xs: List[String]): String = xs match {
+ case List(_,_,_,_*) => "ok"
+ case _ => "not ok"
}
- override def runTest() = {
- val list1 = List();
- assertEquals(doMatch(list1), "not ok");
- val list2 = List("1","2","3");
- assertEquals(doMatch(list2), "ok");
- val list3 = List("1","2","3","4");
- assertEquals(doMatch(list3), "ok");
+ override def runTest() {
+ val list1 = List()
+ assertEquals(doMatch(list1), "not ok")
+ val list2 = List("1","2","3")
+ assertEquals(doMatch(list2), "ok")
+ val list3 = List("1","2","3","4")
+ assertEquals(doMatch(list3), "ok")
}
}
@@ -81,20 +81,16 @@ object Test {
override def runTest() = {
val a = Foo(0, 'a') match {
- case Foo(i, c, chars @ _*) =>
- c
- case _ =>
- null
+ case Foo(i, c, chars @ _*) => c
+ case _ => null
}
- assertEquals(a,'a')
+ assertEquals(a, 'a')
val b = Foo(0, 'a') match {
- case Foo(i, chars @ _*) =>
- 'b'
- case _ =>
- null
+ case Foo(i, chars @ _*) => 'b'
+ case _ => null
}
- assertEquals(b,'b')
+ assertEquals(b, 'b')
}
}
@@ -104,7 +100,7 @@ object Test {
case class Foo() extends Con
case class Bar(xs:Con*) extends Con
- override def runTest() = {
+ override def runTest() {
val res = (Bar(Foo()):Con) match {
case Bar(xs@_*) => xs // this should be optimized away to a pattern Bar(xs)
case _ => Nil
@@ -115,18 +111,15 @@ object Test {
class Test06 extends TestCase("sei (not regular) fancy guards / bug#644 ") {
- case class A(i:Any)
+ case class A(i: Any)
- def doMatch(x:Any, bla:int) = x match {
- case x:A if (bla==1) =>
- 0
- case A(1) =>
- 1
- case A(A(1)) =>
- 2
+ def doMatch(x: Any, bla: int) = x match {
+ case x:A if (bla==1) => 0
+ case A(1) => 1
+ case A(A(1)) => 2
}
- override def runTest(): Unit= {
+ override def runTest() {
assertEquals(doMatch(A(null),1), 0)
assertEquals(doMatch(A(1),2), 1)
assertEquals(doMatch(A(A(1)),2), 2)
@@ -135,7 +128,7 @@ object Test {
}
class Test07 extends TestCase("sette List of chars") {
- def doMatch1(xs:List[char]) = xs match {
+ def doMatch1(xs: List[char]) = xs match {
case List(x, y, _*) => x::y::Nil
}
def doMatch2(xs:List[char]) = xs match {
@@ -150,4 +143,16 @@ object Test {
//assertEquals(doMatch3(List('a','b','c','d')), List('d'))
}
}
+
+ class Test08 extends TestCase("backquoted identifiers in pattern") {
+ override def runTest() {
+ val xs = List(2, 3)
+ val ys = List(1, 2, 3) match {
+ case x :: `xs` => xs
+ case _ => Nil
+ }
+ assertEquals(xs, ys)
+ }
+ }
+
}