summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/t4431.check7
-rw-r--r--test/files/neg/t4431.scala16
2 files changed, 23 insertions, 0 deletions
diff --git a/test/files/neg/t4431.check b/test/files/neg/t4431.check
new file mode 100644
index 0000000000..7896ec1a62
--- /dev/null
+++ b/test/files/neg/t4431.check
@@ -0,0 +1,7 @@
+t4431.scala:5: error: class BB needs to be abstract, since there is a deferred declaration of method f which is not implemented in a subclass
+ class BB extends B { def f (): Unit }
+ ^
+t4431.scala:8: error: trait cannot redefine final method from class AnyRef
+ trait C { def wait (): Unit }
+ ^
+two errors found
diff --git a/test/files/neg/t4431.scala b/test/files/neg/t4431.scala
new file mode 100644
index 0000000000..5fbb239e04
--- /dev/null
+++ b/test/files/neg/t4431.scala
@@ -0,0 +1,16 @@
+object Test {
+ // this works.
+ class B { final def f(): Unit = () }
+ trait A extends B { def f (): Unit }
+ class BB extends B { def f (): Unit }
+
+ // this earns a VerifyError.
+ trait C { def wait (): Unit }
+ class D { }
+
+ def main(args: Array[String]): Unit = {
+ new B with A { }
+ new BB
+// new D with C { }
+ }
+}