Aladdin - Scala Bugtracking
[#223] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2003-11-12 09:30:27.0
subject match without argument generates illegal code
code
// from file pos/Y.scala
object test {
  def f(x: Object): java.lang.Object = x.match;
}
what happened

Here is the tree after uncurry:

[[Trees after phase uncurry]]
// Scala source: tmp/test.scala
final class test() extends scala.Object() {
  final def f(x: scala.Object): java.lang.Object = {
    {
      class $anon() extends scala.Object() with scala.Function1[(scala.All) => scala.All, scala.All]() {
        final def apply(v0: (scala.All) => scala.All): scala.All = v0.apply(x)
      };
      new $anon()
    }
  }
};
final /*object*/ val test: test = new test();

The argument v0 has type (scala.All) => scala.All and the argument x \ has type scala.Object so the expression v0.apply(x) is illegal.

what expected

A legal tree

[back to overview]
Changes of this bug report
Martin  edited on  2004-04-18 12:11:44.0
`match' now needs to be applied fully, so the example is a static error.