Aladdin - Scala Bugtracking
[#217] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Nikolay Martin fixed 2003-11-05 18:08:03.0
subject missing bridge method in "catch" expressions
code
object Test {

  def foo[t](fun: Function0[t]): t = fun();

  def bar(x: Int): Unit = {
    foo(() => 0);
    ()
  }

  def main(args: Array[String]): Unit = bar(32);

}
what happened
Exception in thread "main" java.lang.AbstractMethodError: Test$$anon$0.apply()Ljava/lang/Object;
	at Test$.foo(tmp/test.scala:3)
	at Test$.bar(tmp/test.scala:6)
	at Test$.main(tmp/test.scala:10)
	at Test.main(tmp/test.scala)

In class Test.$anon$0 (the one that corresponds to () => 0) there's a missing bridg\ e method def apply(x: Any): Any to implement the appropriate Function0 interface metho\ d.

what expected

No runtime error

[back to overview]
Changes of this bug report
Nikolay  edited on  2003-11-05 18:09:13.0
Philippe  edited on  2003-11-06 18:36:46.0

Reduced example and updated what happened and what expected sections.

The problem seems to be related to the introduction of ConstantTypes. If the compiler is run with the -debug it prints the following message:

method apply in