From 080802c84dd71fe6b6912025d4338e8b122a6a9a Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 12 Jul 2007 14:56:50 +0000 Subject: 1. 2. some new tests. 3. split Type.symbol to typeSymbol/termSymbol 4. some fixes to lub opertation --- test/files/neg/bug1181.check | 4 ++++ test/files/neg/bug1181.scala | 12 ++++++++++++ test/files/neg/bug961.check | 2 +- test/files/neg/bug997.check | 4 ++-- test/files/pos/bug1168.scala | 16 ++++++++++++++++ test/files/run/bug1192.check | 2 ++ test/files/run/bug1192.scala | 7 +++++++ 7 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 test/files/neg/bug1181.check create mode 100644 test/files/neg/bug1181.scala create mode 100644 test/files/pos/bug1168.scala create mode 100644 test/files/run/bug1192.check create mode 100755 test/files/run/bug1192.scala (limited to 'test') 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) +} -- cgit v1.2.3