Aladdin - Scala Bugtracking
[#213] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Philippe Philippe fixed 2003-10-29 10:46:13.0
subject Missing bridge methods when All or AllRef is returned
code
trait Foo {
  def testAll: Unit;
  def testAllRef: String;
}

class Bar extends Foo {
  def testAll = (().asInstanceOf[All] : All);
  def testAllRef = ("".asInstanceOf[AllRef] : AllRef);
}

object Test {
  def main(args: Array[String]): Unit = {
    val foo: Foo = new Bar;
    foo.testAll;
    foo.testAllRef;
    ()
  }
}
what happened
Exception in thread "main" java.lang.AbstractMethodError: Bar$class.testAll()V
	at Test$.main(tmp/test.scala:14)
	at Test.main(tmp/test.scala)
what expected

There should be no error. The problem is caused by missing bridge methods. Those are missing because isSubType uses Definitions.ANY_TYPE and Definitions.ANYREF_TYPE which contain wrong value after explicitouter phase.

[back to overview]
Changes of this bug report
Philippe  edited on  2003-10-30 13:57:32.0

Fixed by transforming _TYPE fields into methods in class Definitions.