summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2007-05-30 07:10:09 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2007-05-30 07:10:09 +0000
commitfa4aaf9bcb71fa931d60199d747470f8e17aaeb5 (patch)
tree89c8732f406bf8e4c69261f14d1369284c5504f9 /test
parente45535592acc8522f40a27112c5ba2ff7427bfd0 (diff)
downloadscala-fa4aaf9bcb71fa931d60199d747470f8e17aaeb5.tar.gz
scala-fa4aaf9bcb71fa931d60199d747470f8e17aaeb5.tar.bz2
scala-fa4aaf9bcb71fa931d60199d747470f8e17aaeb5.zip
added regression tests for bugs 1106 and 1136
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/bug1106.check7
-rw-r--r--test/files/neg/bug1106.scala5
-rw-r--r--test/files/pos/bug1136.check2
-rw-r--r--test/files/pos/bug1136.scala8
4 files changed, 22 insertions, 0 deletions
diff --git a/test/files/neg/bug1106.check b/test/files/neg/bug1106.check
new file mode 100644
index 0000000000..3fa595abf1
--- /dev/null
+++ b/test/files/neg/bug1106.check
@@ -0,0 +1,7 @@
+bug1106.scala:2: error: expected class or object definition
+val p = new Par[String]
+^
+bug1106.scala:5: error: expected class or object definition
+new Foo[p.type](p) // crashes compiler
+^
+two errors found
diff --git a/test/files/neg/bug1106.scala b/test/files/neg/bug1106.scala
new file mode 100644
index 0000000000..36b5a0ec8f
--- /dev/null
+++ b/test/files/neg/bug1106.scala
@@ -0,0 +1,5 @@
+class Par[S]
+val p = new Par[String]
+class Foo[T[x]<:Par[x]](t: T[String])
+
+new Foo[p.type](p) // crashes compiler \ No newline at end of file
diff --git a/test/files/pos/bug1136.check b/test/files/pos/bug1136.check
new file mode 100644
index 0000000000..0747cddefb
--- /dev/null
+++ b/test/files/pos/bug1136.check
@@ -0,0 +1,2 @@
+warning: there were unchecked warnings; re-run with -unchecked for details
+one warning found
diff --git a/test/files/pos/bug1136.scala b/test/files/pos/bug1136.scala
new file mode 100644
index 0000000000..fcceaf5473
--- /dev/null
+++ b/test/files/pos/bug1136.scala
@@ -0,0 +1,8 @@
+object test {
+ def foo(s: Int*): Unit = {
+ s.toList match {
+ case t: List[Int] => foo(t: _*)
+ case _ =>
+ }
+ }
+}