summaryrefslogtreecommitdiff
path: root/test/neg
diff options
context:
space:
mode:
Diffstat (limited to 'test/neg')
-rw-r--r--test/neg/bug136.check9
-rw-r--r--test/neg/bug136.scala10
-rw-r--r--test/neg/bug139.check5
-rw-r--r--test/neg/bug139.scala6
-rw-r--r--test/neg/bug140.check4
-rw-r--r--test/neg/bug140.scala7
-rw-r--r--test/neg/bug143.check4
-rw-r--r--test/neg/bug143.scala8
8 files changed, 53 insertions, 0 deletions
diff --git a/test/neg/bug136.check b/test/neg/bug136.check
new file mode 100644
index 0000000000..ea23cb313a
--- /dev/null
+++ b/test/neg/bug136.check
@@ -0,0 +1,9 @@
+bug136.scala:5: type mismatch;
+ found : Bar
+ required: Foo
+ val foo2: Foo = bar;
+ ^
+bug136.scala:7: object bar does not implement Foo
+object bar: Foo {
+ ^
+two errors found
diff --git a/test/neg/bug136.scala b/test/neg/bug136.scala
new file mode 100644
index 0000000000..205e12d704
--- /dev/null
+++ b/test/neg/bug136.scala
@@ -0,0 +1,10 @@
+class Foo;
+class Bar: Foo {
+ val bar: Bar = null;
+ val foo1: Foo = this;
+ val foo2: Foo = bar;
+}
+object bar: Foo {
+ val foo1: Foo = this;
+ val foo2: Foo = bar;
+}
diff --git a/test/neg/bug139.check b/test/neg/bug139.check
new file mode 100644
index 0000000000..8f8d7421a2
--- /dev/null
+++ b/test/neg/bug139.check
@@ -0,0 +1,5 @@
+bug139.scala:5: error overriding type T in class A;
+ type T in class B may not be parameterized
+ type T[A] = Int;
+ ^
+one error found
diff --git a/test/neg/bug139.scala b/test/neg/bug139.scala
new file mode 100644
index 0000000000..433ba7bf6f
--- /dev/null
+++ b/test/neg/bug139.scala
@@ -0,0 +1,6 @@
+abstract class A {
+ type T;
+}
+class B extends A {
+ type T[A] = Int;
+}
diff --git a/test/neg/bug140.check b/test/neg/bug140.check
new file mode 100644
index 0000000000..f8415be2f0
--- /dev/null
+++ b/test/neg/bug140.check
@@ -0,0 +1,4 @@
+bug140.scala:4: object bar does not implement Foo
+object bar: Foo {
+ ^
+one error found
diff --git a/test/neg/bug140.scala b/test/neg/bug140.scala
new file mode 100644
index 0000000000..8bdd5f2b6d
--- /dev/null
+++ b/test/neg/bug140.scala
@@ -0,0 +1,7 @@
+class Foo {
+ def foo: Int = 0
+}
+object bar: Foo {
+ bar.foo;
+ def main(args: Array[String]): Unit = ();
+}
diff --git a/test/neg/bug143.check b/test/neg/bug143.check
new file mode 100644
index 0000000000..479966107a
--- /dev/null
+++ b/test/neg/bug143.check
@@ -0,0 +1,4 @@
+bug143.scala:7: illegal cyclic reference involving type Inner
+ override type Inner = Alias;
+ ^
+one error found
diff --git a/test/neg/bug143.scala b/test/neg/bug143.scala
new file mode 100644
index 0000000000..9414d426d5
--- /dev/null
+++ b/test/neg/bug143.scala
@@ -0,0 +1,8 @@
+abstract class Foo {
+ type Inner;
+ type Alias = Inner;
+}
+
+class Bar extends Foo {
+ override type Inner = Alias;
+}