Aladdin - Scala Bugtracking
[#452] project: compiler priority: low category: bug
submitter assigned to status date submitted
Philippe Martin fixed 2005-07-13 17:00:40.0
subject Use of this should be forbidden in the constructor call of a secondary constructor
code
object Test {
  class Foo(x: Foo) {
    def this() = this(this);
  }
  def main(args: Array[String]): Unit = {
    new Foo();
  }
}
what happened
Exception in thread "main" java.lang.VerifyError: (class: Test$Foo$class, method: <init> signature: (LTest\
$;)V) Expecting to find object/array on stack
	at Test$.main(test.scala:6)
	at Test.main(test.scala:5)
what expected A compile-time error stating that the use of this is forbidden in the constructor call of a secondary constructor.
[back to overview]
Changes of this bug report
Martin  edited on  2006-03-30 13:02:33.0