summaryrefslogtreecommitdiff
path: root/test/files/run/bug3487.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-10-14 05:10:10 +0000
committerPaul Phillips <paulp@improving.org>2010-10-14 05:10:10 +0000
commit77c31e39ecd2d160cc27270fc8ef31eaa56e3444 (patch)
treea3ebbadd16b66d09e7793a63e2b5816b103a89df /test/files/run/bug3487.scala
parentd9e7e347c74a5c89b5594254ddfccf5dd7e9377c (diff)
downloadscala-77c31e39ecd2d160cc27270fc8ef31eaa56e3444.tar.gz
scala-77c31e39ecd2d160cc27270fc8ef31eaa56e3444.tar.bz2
scala-77c31e39ecd2d160cc27270fc8ef31eaa56e3444.zip
An object with a main method can now extend its...
An object with a main method can now extend its companion class without losing the ability to run. Also gave genjvm a wax and polish while in the neigborhood. Closes #3487. I had to get a little tricky with this one. No review per se, but if anyone is frightened by the prospect of the forwarders not being marked final in this case (because as of now, they aren't) then speak now or ACC_FINAL hold your peace.
Diffstat (limited to 'test/files/run/bug3487.scala')
-rw-r--r--test/files/run/bug3487.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/files/run/bug3487.scala b/test/files/run/bug3487.scala
new file mode 100644
index 0000000000..f2ca735913
--- /dev/null
+++ b/test/files/run/bug3487.scala
@@ -0,0 +1,15 @@
+trait Bippy {
+ def bippy = 5
+}
+
+class Test extends Bippy {
+ def f1 = 55
+}
+
+object Test extends Test {
+ def dingus = bippy
+ def main(args: Array[String]): Unit = {
+ assert(bippy + f1 == 110)
+ }
+ override def bippy = 55
+}