Aladdin - Scala Bugtracking
[#336] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2004-06-04 13:15:21.0
subject LambdaLift creates unexpected overrides
code
class A {
  def foo(x: Int)(y: Int): Int = 1;
}

object Test extends A {
  def foo(x: Int, y: Int): Int = 2;
  def main(args: Array[String]): Unit = {
    System.out.println(foo(0)(0));
  }
}
what happened
Prints 2 at runtime.
what expected The program should either print 1 or there should be an error because the two methods foo have different signatures but are lambda lifted to the same signature.
[back to overview]
Changes of this bug report
Philippe  edited on  2004-06-04 13:20:31.0
See also bug 337.
Martin  edited on  2004-07-02 18:46:11.0
Uncurry now checks for all double definitions, accidental overrides, etc. The conflict detection includes erasure. So, assuming method Type.erasure is up-to-date, we can forget about double declaration checking in phase erasure (we still need to check for conflicts involving bridge methods, however).