summaryrefslogtreecommitdiff
path: root/test/files/run
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/run
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/run')
-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
4 files changed, 12 insertions, 2 deletions
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