summaryrefslogtreecommitdiff
path: root/test/files/run
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run')
-rw-r--r--test/files/run/bug1042.check1
-rw-r--r--test/files/run/bug1042.scala14
-rw-r--r--test/files/run/preinits.check3
-rw-r--r--test/files/run/preinits.scala6
-rw-r--r--test/files/run/t0048.check1
-rw-r--r--test/files/run/t0048.scala13
6 files changed, 38 insertions, 0 deletions
diff --git a/test/files/run/bug1042.check b/test/files/run/bug1042.check
new file mode 100644
index 0000000000..223b7836fb
--- /dev/null
+++ b/test/files/run/bug1042.check
@@ -0,0 +1 @@
+B
diff --git a/test/files/run/bug1042.scala b/test/files/run/bug1042.scala
new file mode 100644
index 0000000000..32eb49a7ec
--- /dev/null
+++ b/test/files/run/bug1042.scala
@@ -0,0 +1,14 @@
+abstract class A {
+ override def toString(): String // crucial
+
+ def toString(sb: StringBuilder): StringBuilder // crucial
+}
+
+case class B() extends A {
+ // overloaded version is implemented, causing toString not to be implemented?
+ def toString(sb: StringBuilder): StringBuilder = error("")
+}
+
+object Test extends Application {
+ Console.println(B)
+}
diff --git a/test/files/run/preinits.check b/test/files/run/preinits.check
new file mode 100644
index 0000000000..5584ab261e
--- /dev/null
+++ b/test/files/run/preinits.check
@@ -0,0 +1,3 @@
+A
+B
+2
diff --git a/test/files/run/preinits.scala b/test/files/run/preinits.scala
new file mode 100644
index 0000000000..8de43b62ea
--- /dev/null
+++ b/test/files/run/preinits.scala
@@ -0,0 +1,6 @@
+trait A { val x: Int; println("A") }
+trait B extends { override val x = 1 } with A { println("B") }
+trait C extends { override val x = 2 } with A
+object Test extends B with C with Application {
+ println(x)
+}
diff --git a/test/files/run/t0048.check b/test/files/run/t0048.check
new file mode 100644
index 0000000000..1e8b314962
--- /dev/null
+++ b/test/files/run/t0048.check
@@ -0,0 +1 @@
+6
diff --git a/test/files/run/t0048.scala b/test/files/run/t0048.scala
new file mode 100644
index 0000000000..9ee3453cd9
--- /dev/null
+++ b/test/files/run/t0048.scala
@@ -0,0 +1,13 @@
+object A1 {
+ object A2 {
+ class X { def unapply(v : Int) = Some(v + 1) }
+ }
+}
+
+object Test {
+ def main(args: Array[String]) {
+ val q = new A1.A2.X
+ val res = 5 match { case q(x) => x }
+ println(res)
+ }
+}