From 77c31e39ecd2d160cc27270fc8ef31eaa56e3444 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Thu, 14 Oct 2010 05:10:10 +0000 Subject: 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. --- test/files/run/bug3487.scala | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/files/run/bug3487.scala (limited to 'test') 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 +} -- cgit v1.2.3