summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/bug1.scala8
-rw-r--r--test/files/pos/bug2.scala6
-rw-r--r--test/files/pos/bug20.scala8
-rw-r--r--test/files/pos/bug49.scala3
-rw-r--r--test/files/pos/bug50.scala8
-rw-r--r--test/files/pos/bug53.scala7
-rw-r--r--test/files/pos/bug54.scala4
-rw-r--r--test/files/pos/bug61.scala10
-rw-r--r--test/files/pos/bug64.scala6
-rw-r--r--test/files/pos/bug66.scala7
-rw-r--r--test/files/pos/bug68.scala6
-rw-r--r--test/files/pos/bug69.scala11
-rw-r--r--test/files/pos/bug76.scala9
-rw-r--r--test/files/pos/test4.scala12
14 files changed, 99 insertions, 6 deletions
diff --git a/test/files/pos/bug1.scala b/test/files/pos/bug1.scala
new file mode 100644
index 0000000000..bdf33ef20d
--- /dev/null
+++ b/test/files/pos/bug1.scala
@@ -0,0 +1,8 @@
+object Exceptions {
+
+ class CubeException(s: String) extends java.lang.RuntimeException(s);
+
+ def main(args: Array[String]) =
+ System.out.println(new CubeException("test"));
+
+}
diff --git a/test/files/pos/bug2.scala b/test/files/pos/bug2.scala
new file mode 100644
index 0000000000..4c58ed3f4f
--- /dev/null
+++ b/test/files/pos/bug2.scala
@@ -0,0 +1,6 @@
+object main {
+ def main(args: Array[String]) = {
+ val b = true;
+ while (b == true) { }
+ }
+}
diff --git a/test/files/pos/bug20.scala b/test/files/pos/bug20.scala
new file mode 100644
index 0000000000..bdf33ef20d
--- /dev/null
+++ b/test/files/pos/bug20.scala
@@ -0,0 +1,8 @@
+object Exceptions {
+
+ class CubeException(s: String) extends java.lang.RuntimeException(s);
+
+ def main(args: Array[String]) =
+ System.out.println(new CubeException("test"));
+
+}
diff --git a/test/files/pos/bug49.scala b/test/files/pos/bug49.scala
new file mode 100644
index 0000000000..913ce06e00
--- /dev/null
+++ b/test/files/pos/bug49.scala
@@ -0,0 +1,3 @@
+class C1(x: Object) {};
+
+class C2 extends C1({ class A extends Object {}; (new A) : Object }) {};
diff --git a/test/files/pos/bug50.scala b/test/files/pos/bug50.scala
new file mode 100644
index 0000000000..0989af44fa
--- /dev/null
+++ b/test/files/pos/bug50.scala
@@ -0,0 +1,8 @@
+import scala.runtime.NativeMonitor;
+
+case class Foo[a](x: a);
+
+object bug {
+ Foo("");
+ NativeMonitor.synchronised(null, "");
+}
diff --git a/test/files/pos/bug53.scala b/test/files/pos/bug53.scala
new file mode 100644
index 0000000000..44763ef144
--- /dev/null
+++ b/test/files/pos/bug53.scala
@@ -0,0 +1,7 @@
+object bug {
+ def foobar[c]: Int = {
+ class Foo { def foo: Bar = new Bar(); }
+ class Bar { def bar: c = bar; }
+ 0
+ }
+}
diff --git a/test/files/pos/bug54.scala b/test/files/pos/bug54.scala
new file mode 100644
index 0000000000..3dc8e161fd
--- /dev/null
+++ b/test/files/pos/bug54.scala
@@ -0,0 +1,4 @@
+class A {
+ case class B(x: C) extends A {}
+ class C {}
+}
diff --git a/test/files/pos/bug61.scala b/test/files/pos/bug61.scala
new file mode 100644
index 0000000000..dd3f94f30c
--- /dev/null
+++ b/test/files/pos/bug61.scala
@@ -0,0 +1,10 @@
+object O {
+
+ class testClass ;
+
+ case class testA() extends testClass ; // works if you leave away "extends..."
+ // or if you write TestA
+ def ga( x:testClass ) = x match {
+ case testA() => ()
+ }
+}
diff --git a/test/files/pos/bug64.scala b/test/files/pos/bug64.scala
new file mode 100644
index 0000000000..c2ce4bf6d0
--- /dev/null
+++ b/test/files/pos/bug64.scala
@@ -0,0 +1,6 @@
+object B {
+ def main(Args:Array[String]) = {
+ val Pair(_,x) = Pair(1,2);
+ x + 1;
+ }
+}
diff --git a/test/files/pos/bug66.scala b/test/files/pos/bug66.scala
new file mode 100644
index 0000000000..2153264e7a
--- /dev/null
+++ b/test/files/pos/bug66.scala
@@ -0,0 +1,7 @@
+class GBTree[A, B] /*with Map[A, B, GBTree[A,B]]*/ {
+ abstract class Tree[A,B];
+ case class Node[A,B](key:A,value:B,smaller:Node[A,B],bigger:Node[A,B])
+ extends Tree[A,B];
+ case class Nil[A,B]() extends Tree[A,B];
+
+}
diff --git a/test/files/pos/bug68.scala b/test/files/pos/bug68.scala
new file mode 100644
index 0000000000..beb2c7c0ab
--- /dev/null
+++ b/test/files/pos/bug68.scala
@@ -0,0 +1,6 @@
+class E {
+ def f() = {
+ val (_::l1) = List(1,2,3);
+ l1.tail;
+ }
+}
diff --git a/test/files/pos/bug69.scala b/test/files/pos/bug69.scala
new file mode 100644
index 0000000000..113820613f
--- /dev/null
+++ b/test/files/pos/bug69.scala
@@ -0,0 +1,11 @@
+object testCQ {
+ // why does this not work directly
+ case class Thing( name:String, contains:List[ Thing ] );
+
+ /* ... but this one does?
+ abstract class T;
+ case class Thing2( name:String, contains:List[ T ] ) extends T;
+ */
+
+}
+
diff --git a/test/files/pos/bug76.scala b/test/files/pos/bug76.scala
new file mode 100644
index 0000000000..07cddd714f
--- /dev/null
+++ b/test/files/pos/bug76.scala
@@ -0,0 +1,9 @@
+// This is extracted from a test file => don't add a new test file.
+object bug {
+ def foo(def i: Int): Int = 0;
+
+ def bar: Int = {
+ var i: Int = 0;
+ foo (i);
+ }
+}
diff --git a/test/files/pos/test4.scala b/test/files/pos/test4.scala
index 48949b7a7f..66f7a1505c 100644
--- a/test/files/pos/test4.scala
+++ b/test/files/pos/test4.scala
@@ -10,7 +10,7 @@ object test {
import test._;
-trait S extends o.I[D] {
+trait S extends ooo.I[D] {
def bar: E = foo(c,d);
}
@@ -22,14 +22,14 @@ class O[X]() {
val j:I[X] = null;
}
-object o extends O[C]() {
+object ooo extends O[C]() {
def main = {
val s: S = null;
import s._;
foo(c,d);
- o.i.foo(c,e);
- o.j.foo(c,c);
+ ooo.i.foo(c,e);
+ ooo.j.foo(c,c);
bar
}
}
@@ -38,8 +38,8 @@ class Main() {
val s: S = null;
import s._;
foo(c,d);
- o.i.foo(c,e);
- o.j.foo(c,c);
+ ooo.i.foo(c,e);
+ ooo.j.foo(c,c);
bar;
}