Aladdin - Scala Bugtracking
[#167] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2003-09-30 18:17:19.0
subject lambdalift wrongly lifts local variables having the same name as class arguments
code
class Node(bar:Int) {
  val foo = {
    val bar = 1;
    bar
  }
}

object Test {
  def main(args: Array[String]): Unit = {
    System.out.println(new Node(0).foo);
  }
}
what happened

Program prints: 0

what expected

Program prints: 1

The problem is that method LambdaLiftPhase.proxy returns the class arguments bar when it is invoked with the local variable bar.

[back to overview]
Changes of this bug report
Philippe  edited on  2003-09-30 18:41:09.0
Fixed by modifiying LambdaLiftPhase.proxy so that it compares enclFun of owners instead of owners directly.