summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2011-04-08 16:31:26 +0000
committerMartin Odersky <odersky@gmail.com>2011-04-08 16:31:26 +0000
commit26c3f65241f49d96e2b3e853f71aa780ca8861c1 (patch)
tree8cc94c67ca1a884ace6333e00d8cb8c44e9dcdef /test/files
parentb13ef720c09f1a7b6e3263faebcb0be7785a5337 (diff)
downloadscala-26c3f65241f49d96e2b3e853f71aa780ca8861c1.tar.gz
scala-26c3f65241f49d96e2b3e853f71aa780ca8861c1.tar.bz2
scala-26c3f65241f49d96e2b3e853f71aa780ca8861c1.zip
Closes #4431. Review by extempore.
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 { }
+ }
+}