Aladdin - Scala Bugtracking
[#920] project: compiler priority: low category: bug
submitter assigned to status date submitted
Sean Martin fixed 2007-01-29 12:19:43.0
subject verify error when using method-defined trait that depends on outer context
code
package test;
object Test {
  trait A;
  trait Foo { def foo : A; }
  trait Bar extends Foo;
  trait B extends A {
    def initialize = {
      trait Foo extends Test.Foo {
        def foo : B.this.type = B.this;
      }
      class bar extends Bar with Foo;
      Console.println(new bar);
    }
  }
  object b extends B;
  def main(args : Array[String]) : Unit = {
    b.initialize;
  }
}
what happened
When running test:
Exception in thread "main" java.lang.VerifyError: (class: test/Test$B$bar$0, method: test$Test$B$Foo$$$oute\
r signature: ()Ltest/Test$B;) Unable to pop operand off an empty stack
	at test.Test$B$class.initialize(Test.scala:15)
	at test.Test$b$.initialize(Test.scala:20)
	at test.Test$.main(Test.scala:22)
	at test.Test.main(Test.scala)
what expected
[back to overview]
Changes of this bug report
Iulian  edited on  2007-01-29 15:37:25.0
I assigned this to Martin since it is a problem with outer pointers. It seems the trait-inherited outer pointer for Foo is not implemented (and not abstract either) in class Test.B.bar. I added an assertion in the backend that fails for unimplemented concrete methods.
Martin  edited on  2007-01-30 19:32:12.0