Aladdin - Scala Bugtracking
[#496] project: nsc priority: low category: bug
submitter assigned to status date submitted
Iulian Martin fixed 2005-11-23 15:30:29.0
subject constructor parameter does not get a field when used only from inner classes
code
class X();

class O(a: Int) {

  case class Y(b: Int) extends X() {
    def bar = a + b;
  }

  def foo = Y(2).bar
}

object Main extends AnyRef with Application {
  Console.println(new O(1).foo)
}
what happened
the output is '2' instead of '3'. The constructor parameter of O gets a corresponding field in O, but it is not \
initialized in the constructor.
what expected ..
[back to overview]
Changes of this bug report
Iulian  edited on  2005-11-23 15:59:34.0
Martin  edited on  2005-11-24 15:21:01.0