Crash in LambdaLift
Exception in thread "main" java.lang.AssertionError: type X in method apply
at scalac.transformer.LambdaLift$FreeVars.markFree(LambdaLift.java:178)
However, there is already a problem after the analyzer as can be seen in the following tree.
[[syntax trees at refcheck (after analyze)]]
// Scala source: tmp/test.scala
class Foo[X] extends java.lang.Object() with scala.ScalaObject();
final object Test extends java.lang.Object() with scala.ScalaObject() {
final def apply[X](): Foo[X] = null;
final def main(args: scala.Array[scala.Predef.String]): scala.Unit = {
Test.apply[scala.All]().toString();
Test.apply[X]().match({
case _ => ()
});
scala.List.apply[A]().match({
case _ => ()
})
}
};
The expressions Test() match and List match are translated into trees that contain the\
type variables X and A which are never declared.
|