Aladdin - Scala Bugtracking
[#235] project: specification priority: high category: missing feature
submitter assigned to status date submitted
Burak _ won't fix 2003-11-24 18:41:36.0
subject overriding in constructors?
code
object bug {
  abstract class A {
    protected val foo = null.toString();
  }
  case class B() extends A {
    override val foo = "foo";
  }
  def main(args:Array[String]) = {
    val b = B();
  }
}
what happened
at runtime: 
Exception in thread "main" java.lang.NullPointerException
	at bug$A$class.(bug.scala:3)
	at bug$B$class.(bug.scala:6)
	at bug$.main(bug.scala:11)
	at bug.main(bug.scala)
what expected that the righthand side of foo in A is not evaluated.
[back to overview]
Changes of this bug report
Martin  edited on  2003-11-24 19:50:33.0
This is not what the spec says.