Aladdin - Scala Bugtracking
[#84] project: compiler priority: medium category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2003-08-12 12:19:30.0
subject missing subst in lambdalift
code
trait Foo[a];

object Bar {
  def f[b]: Int = {
    def g(x:b): Foo[b] = g(x);
    0
  }
}
what happened
scalarun -uniqid -types -nopredefs tmp/bug_interpreter.scala -print:lambda

The command above prints the following tree (I removed unrelevant information)

abstract class Foo#13[a#14 ...]() extends scala.Object();
final class Bar#19() extends scala.Object() {
  final def f#20[b$0#21 ...](): scala.Int = 0;
  def g$0#23[b$0#24 ...](x#25: b$0#24): Foo[b$0#24] =
    g$0#23{[b$0#24](b$0#21)Foo#13[b$0#21]}[b$0#24](x#25){Foo#13[b$0#24]}
};

The reference to g$0 in the rhs of g$0 has type [b$0#24](b$0#21)Foo#13[b$0#21].
what expected The type of g$0 should be [b$0#24](b$0#24)Foo#13[b$0#24]. The problem is that when lambdlift in method LambdaList.liftSymbol replaces fvs and ftvs by additional params and tparams, it does not perform a substitution from fvs/ftvs to params/tparams.
[back to overview]
Changes of this bug report
Martin  edited on  2003-08-13 15:01:28.0