Aladdin - Scala Bugtracking
[#655] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Iulian fixed 2006-07-11 16:22:07.0
subject line number info off for empty if-block
code
package test;

object Test {
  def main(args : Array[String]) : Unit = {
    Console.println("BEGIN");
    if (f) {
      // is true, should step here or skip to end of if block
    } else {
      // But debugger steps stops at next line!
      Console.println("HELLO");
    }
    Console.println("END");
  }
  def f = true;
}
what happened
f is always true, but debugger steps to Console.println("HELLO"), although this line number executes. For some r\
eason the line number information is messed up for if statements with empty then blocks.
what expected Debugger should step over entire if statement, as in Java. This means the line number following the condition on the true branch should be the line after the if statement.
[back to overview]
Changes of this bug report
Martin  edited on  2006-07-11 16:58:05.0
I verified that the tree carries the correct position, so it's probably in the bytecode generator. NOTE: I added a new option -Xprintpos to show positions in the tree. Just so that we can do proper blame assignment :-)
Iulian  edited on  2006-07-11 17:22:51.0