summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/bug910.check6
-rw-r--r--test/files/neg/bug910.scala7
-rw-r--r--test/files/neg/bug987.check9
-rw-r--r--test/files/neg/bug987.scala25
-rw-r--r--test/files/run/bug995.check1
-rw-r--r--test/files/run/bug995.scala12
6 files changed, 60 insertions, 0 deletions
diff --git a/test/files/neg/bug910.check b/test/files/neg/bug910.check
new file mode 100644
index 0000000000..c52d7a87df
--- /dev/null
+++ b/test/files/neg/bug910.check
@@ -0,0 +1,6 @@
+bug910.scala:4: error: type mismatch;
+ found : scala.Seq[scala.Char]
+ required: scala.Seq[scala.Int]
+ val y: Seq[int] = rest
+ ^
+one error found
diff --git a/test/files/neg/bug910.scala b/test/files/neg/bug910.scala
new file mode 100644
index 0000000000..2f28ea408f
--- /dev/null
+++ b/test/files/neg/bug910.scala
@@ -0,0 +1,7 @@
+object RegExpTest1 extends Application {
+ def co(x: Seq[Char]) = x match {
+ case Seq('s','c','a','l','a', rest @ _*) =>
+ val y: Seq[int] = rest
+ y
+ }
+}
diff --git a/test/files/neg/bug987.check b/test/files/neg/bug987.check
new file mode 100644
index 0000000000..3e9c19217d
--- /dev/null
+++ b/test/files/neg/bug987.check
@@ -0,0 +1,9 @@
+bug987.scala:15: error: the type intersection B[D] with B[C] is malformed
+ --- because ---
+no common type instance of base types B[C] and B[D] exists
+class E extends D
+^
+bug987.scala:20: error: illegal cyclic reference involving class D
+class F extends D
+^
+two errors found
diff --git a/test/files/neg/bug987.scala b/test/files/neg/bug987.scala
new file mode 100644
index 0000000000..dcd3ce1d07
--- /dev/null
+++ b/test/files/neg/bug987.scala
@@ -0,0 +1,25 @@
+// tested using Scala compiler version 2.4.0-RC1 -- (c) 2002-2007 LAMP/EPFL
+
+// Many thanks to all at LAMP for the work that goes into Scala.
+
+
+class A {}
+
+trait B[T <: B[T]] requires T {}
+
+abstract class C extends A with B[C]
+{
+ protected val data: List[Int]
+}
+
+class E extends D
+{
+ val data = Nil
+}
+
+class F extends D
+{
+ val data = Nil
+}
+
+abstract class D extends C with B[D] {}
diff --git a/test/files/run/bug995.check b/test/files/run/bug995.check
new file mode 100644
index 0000000000..f0f0e34bb3
--- /dev/null
+++ b/test/files/run/bug995.check
@@ -0,0 +1 @@
+Seq
diff --git a/test/files/run/bug995.scala b/test/files/run/bug995.scala
new file mode 100644
index 0000000000..f7f75b6a02
--- /dev/null
+++ b/test/files/run/bug995.scala
@@ -0,0 +1,12 @@
+object Test extends Application {
+ def foo(v: Any): String = v match {
+ case s: Seq[_] =>
+ "Seq"
+ // see Burak's hack in object Seq.unapplySeq
+ //case a: AnyRef if runtime.ScalaRunTime.isArray(a) =>
+ // "Array"
+ case _ =>
+ v.toString
+ }
+ Console.println(foo(Array(0)))
+}