summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-07-23 18:22:29 +0000
committerMartin Odersky <odersky@gmail.com>2007-07-23 18:22:29 +0000
commit16d3cf1f8f22c04559145b35bb5f6c0aacfb0d8c (patch)
tree75b5420467e9dae2ef88d6a4aca220b0f907fa2f /test/files
parent2d3a640e0bff8c79f99c070cf33f9ef921642a18 (diff)
downloadscala-16d3cf1f8f22c04559145b35bb5f6c0aacfb0d8c.tar.gz
scala-16d3cf1f8f22c04559145b35bb5f6c0aacfb0d8c.tar.bz2
scala-16d3cf1f8f22c04559145b35bb5f6c0aacfb0d8c.zip
many bug fixes; short syntax for structural types.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/bug835.check9
-rw-r--r--test/files/neg/bug875.check12
-rw-r--r--test/files/pos/bug602.scala4
-rwxr-xr-xtest/files/run/existentials.scala3
-rw-r--r--test/files/run/regularpatmatnew.scala2
-rw-r--r--test/files/run/withIndex.check2
-rw-r--r--test/files/run/withIndex.scala7
7 files changed, 31 insertions, 8 deletions
diff --git a/test/files/neg/bug835.check b/test/files/neg/bug835.check
index 83db589280..79ea97b71f 100644
--- a/test/files/neg/bug835.check
+++ b/test/files/neg/bug835.check
@@ -1,4 +1,9 @@
-bug835.scala:2: error: _*-argument may not appear after other arguments matching a *-parameter
+bug835.scala:2: error: no `: _*' annotation allowed here
+(such annotations are only allowed in arguments to *-parameters)
+ Console.println(List(List(1, 2, 3) : _*, List(4, 5, 6) : _*))
+ ^
+bug835.scala:2: error: no `: _*' annotation allowed here
+(such annotations are only allowed in arguments to *-parameters)
Console.println(List(List(1, 2, 3) : _*, List(4, 5, 6) : _*))
^
-one error found
+two errors found
diff --git a/test/files/neg/bug875.check b/test/files/neg/bug875.check
index 63ad0f7eb0..d547c8d69c 100644
--- a/test/files/neg/bug875.check
+++ b/test/files/neg/bug875.check
@@ -1,13 +1,17 @@
-bug875.scala:3: error: _*-argument may not appear after other arguments matching a *-parameter
+bug875.scala:3: error: no `: _*' annotation allowed here
+(such annotations are only allowed in arguments to *-parameters)
val ys = List(1, 2, 3, xs: _*)
^
-bug875.scala:6: error: _*-argument does not correspond to *-parameter
+bug875.scala:6: error: no `: _*' annotation allowed here
+(such annotations are only allowed in arguments to *-parameters)
mkList(xs: _*)
^
-bug875.scala:15: error: _*-argument may not appear after other arguments matching a *-parameter
+bug875.scala:15: error: no `: _*' annotation allowed here
+(such annotations are only allowed in arguments to *-parameters)
f(true, 1, xs: _*)
^
-bug875.scala:16: error: _*-argument may not appear after other arguments matching a *-parameter
+bug875.scala:16: error: no `: _*' annotation allowed here
+(such annotations are only allowed in arguments to *-parameters)
g(1, xs:_*)
^
four errors found
diff --git a/test/files/pos/bug602.scala b/test/files/pos/bug602.scala
index 60aef1dfd0..5877d08ddc 100644
--- a/test/files/pos/bug602.scala
+++ b/test/files/pos/bug602.scala
@@ -1,6 +1,10 @@
package com.mosol.sl;
case class Span[K <: Ordered[K]](low: Option[K], high: Option[K]) extends Function1[K, boolean] {
+ override def equals(x$1: Any): Boolean = x$1 match {
+ case Span((low$0 @ _), (high$0 @ _)) if low$0.equals(low).$amp$amp(high$0.equals(high)) => true
+ case _ => false
+ }
def apply(k: K): boolean = this match {
case Span(Some(low), Some(high)) => (k >= low && k <= high)
case Span(Some(low), None) => (k >= low)
diff --git a/test/files/run/existentials.scala b/test/files/run/existentials.scala
index a08a9da9b3..9dc9855a75 100755
--- a/test/files/run/existentials.scala
+++ b/test/files/run/existentials.scala
@@ -52,6 +52,9 @@ object Bug1189 {
object Test extends Application {
+ val x = { class I[T]; (new C(new I[String]), new C(new I[Int])) }
+ val y: (C[X], C[Y]) forSome { type X; type Y } = x
+
def foo(x : Counter[T] { def name : String } forSome { type T }) = x match {
case ctr: Counter[t] =>
val c = ctr.newCounter
diff --git a/test/files/run/regularpatmatnew.scala b/test/files/run/regularpatmatnew.scala
index 0457cd6d6c..c610b80444 100644
--- a/test/files/run/regularpatmatnew.scala
+++ b/test/files/run/regularpatmatnew.scala
@@ -105,7 +105,7 @@ object Test {
case Bar(xs@_*) => xs // this should be optimized away to a pattern Bar(xs)
case _ => Nil
}
- assertEquals("res instance"+res.isInstanceOf[Seq[Con]]+" res(0)="+res(0), true, res.isInstanceOf[Seq[Foo]] && res(0) == Foo() )
+ assertEquals("res instance"+res.isInstanceOf[Seq[Con] forSome { type Con }]+" res(0)="+res(0), true, res.isInstanceOf[Seq[Foo] forSome { type Foo}] && res(0) == Foo() )
}
}
diff --git a/test/files/run/withIndex.check b/test/files/run/withIndex.check
index 6a9c7aaadb..e8060bb1d7 100644
--- a/test/files/run/withIndex.check
+++ b/test/files/run/withIndex.check
@@ -1,3 +1,5 @@
+warning: there were unchecked warnings; re-run with -unchecked for details
+one warning found
List((a,0), (b,1), (c,2))
List((a,0), (b,1), (c,2))
List((a,0), (b,1), (c,2))
diff --git a/test/files/run/withIndex.scala b/test/files/run/withIndex.scala
index fd79cd808a..d06dde89f0 100644
--- a/test/files/run/withIndex.scala
+++ b/test/files/run/withIndex.scala
@@ -9,7 +9,12 @@ object Test {
Console.println(lst.zipWithIndex.toList)
Console.println(itr.zipWithIndex.toList)
Console.println(str.zipWithIndex.toList)
- assert(ary.zipWithIndex.isInstanceOf[Array[Pair[String,Int]]])
+ assert {
+ ary.zipWithIndex match {
+ case _: Array[Pair[String,Int]] => true
+ case _ => false
+ }
+ }
val emptyArray = new Array[String](0)
val emptyList: List[String] = Nil