summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-07-12 14:56:50 +0000
committerMartin Odersky <odersky@gmail.com>2007-07-12 14:56:50 +0000
commit080802c84dd71fe6b6912025d4338e8b122a6a9a (patch)
treeca64772a9fdf2912d2cfcadae2bacebc37e29202 /test/files
parenta874f351097b67eef720bb64faffc603070526ed (diff)
downloadscala-080802c84dd71fe6b6912025d4338e8b122a6a9a.tar.gz
scala-080802c84dd71fe6b6912025d4338e8b122a6a9a.tar.bz2
scala-080802c84dd71fe6b6912025d4338e8b122a6a9a.zip
1.
2. some new tests. 3. split Type.symbol to typeSymbol/termSymbol 4. some fixes to lub opertation
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/bug1181.check4
-rw-r--r--test/files/neg/bug1181.scala12
-rw-r--r--test/files/neg/bug961.check2
-rw-r--r--test/files/neg/bug997.check4
-rw-r--r--test/files/pos/bug1168.scala16
-rw-r--r--test/files/run/bug1192.check2
-rwxr-xr-xtest/files/run/bug1192.scala7
7 files changed, 44 insertions, 3 deletions
diff --git a/test/files/neg/bug1181.check b/test/files/neg/bug1181.check
new file mode 100644
index 0000000000..0baf975f9b
--- /dev/null
+++ b/test/files/neg/bug1181.check
@@ -0,0 +1,4 @@
+bug1181.scala:9: error: not a legal formal parameter
+ _ => buildMap(map.update(keyList.head, valueList.head), keyList.tail, valueList.tail)
+ ^
+one error found
diff --git a/test/files/neg/bug1181.scala b/test/files/neg/bug1181.scala
new file mode 100644
index 0000000000..fbbb2a84d4
--- /dev/null
+++ b/test/files/neg/bug1181.scala
@@ -0,0 +1,12 @@
+package test
+
+import scala.collection.immutable.Map
+
+class CompilerTest(val valueList: List[Symbol]) {
+ def buildMap(map: Map[Symbol, Symbol], keyList: List[Symbol], valueList: List[Symbol]): Map[Symbol, Symbol] = {
+ (keyList, valueList) match {
+ case (Nil, Nil) => map
+ _ => buildMap(map.update(keyList.head, valueList.head), keyList.tail, valueList.tail)
+ }
+ }
+}
diff --git a/test/files/neg/bug961.check b/test/files/neg/bug961.check
index 015480b021..559dd93d6f 100644
--- a/test/files/neg/bug961.check
+++ b/test/files/neg/bug961.check
@@ -1,4 +1,4 @@
-bug961.scala:11: error: Temp.this.B does not take parameters
+bug961.scala:11: error: Temp.this.B of type object Temp.this.B does not take parameters
B() match {
^
one error found
diff --git a/test/files/neg/bug997.check b/test/files/neg/bug997.check
index 13ea7f8fdb..90a1123738 100644
--- a/test/files/neg/bug997.check
+++ b/test/files/neg/bug997.check
@@ -1,10 +1,10 @@
-bug997.scala:7: error: wrong number of arguments for object Foo of type Foo.type
+bug997.scala:7: error: wrong number of arguments for object Foo of type object Foo
"x" match { case Foo(a) => Console.println(a) }
^
bug997.scala:7: error: not found: value a
"x" match { case Foo(a) => Console.println(a) }
^
-bug997.scala:13: error: wrong number of arguments for object Foo of type Foo.type
+bug997.scala:13: error: wrong number of arguments for object Foo of type object Foo
"x" match { case Foo(a, b, c) => Console.println((a,b,c)) }
^
bug997.scala:13: error: not found: value a
diff --git a/test/files/pos/bug1168.scala b/test/files/pos/bug1168.scala
new file mode 100644
index 0000000000..58407e328e
--- /dev/null
+++ b/test/files/pos/bug1168.scala
@@ -0,0 +1,16 @@
+object Test extends Application {
+
+ trait SpecialException {}
+
+ try {
+ throw new Exception
+ } catch {
+ case e : SpecialException => {
+ println("matched SpecialException: "+e)
+ assume(e.isInstanceOf[SpecialException])
+ }
+ case e : Exception => {
+ assume(e.isInstanceOf[Exception])
+ }
+ }
+}
diff --git a/test/files/run/bug1192.check b/test/files/run/bug1192.check
new file mode 100644
index 0000000000..57234e1d8a
--- /dev/null
+++ b/test/files/run/bug1192.check
@@ -0,0 +1,2 @@
+Array(1, 2)
+Array(3, 4)
diff --git a/test/files/run/bug1192.scala b/test/files/run/bug1192.scala
new file mode 100755
index 0000000000..9e9173b0dc
--- /dev/null
+++ b/test/files/run/bug1192.scala
@@ -0,0 +1,7 @@
+object Test extends Application {
+ val v1: Array[Array[Int]] = Array(Array(1, 2), Array(3, 4))
+ def f[T](w: Array[Array[T]]) {
+ for (val r <- w) println(r.toString)
+ }
+ f(v1)
+}