Aladdin - Scala Bugtracking
[#908] project: compiler priority: high category: bug
submitter assigned to status date submitted
Iulian Martin fixed 2007-01-22 10:39:47.0
subject no error calling virtual methods from constructor, when viewable-bounds exist
code
abstract class A[T <% Ordered[T]] {
  def makeA = new Object
//  case object default extends Object
}

class C[T <% Ordered[T]](foo: Object) extends A[T] {
  def this() = {
    this(makeA)
    // this(default)
  }
}
what happened
No error.
what expected 'makeA' should not be visible inside constructor definitions before the default constructor is called. Not doing so results in virtual method calls on an un-initialized object instance, which results in VerifyErrors. Note that this bug is not yet released (only the svn compiler exhibits this behavior). It seems to have something to do with viewable bounds (removing them gets the expected error).
[back to overview]
Changes of this bug report
Iulian  edited on  2007-01-22 10:40:43.0
I made this bug a high priority since it prevents Lex's changes to TreeMap & co to be committed (I had them reverted Friday to unlock ant dist).
Martin  edited on  2007-01-23 16:16:13.0
Martin  edited on  2007-01-23 16:16:56.0