Aladdin - Scala Bugtracking
[#264] project: compiler priority: high category: bug
submitter assigned to status date submitted
Stephane Martin not repro 2004-01-05 11:10:44.0
subject Assertion error with case class instantiation
code
case class Foo(n: Int): Object;

object bug {
  //new Foo(0); // is OK
  Foo(0)
}
what happened
$ scalac -d ~/tmp/classes/ bug.scala
Exception in thread "main" java.lang.AssertionError:
unit        : bug.scala
clasz       : bug
member      : bug.
owner       : bug.
tree        : $class(0)
tree.pos    : 6:3
tree.symbol : null
tree.type   : Unit
params      : []
        at scalac.checkers.TreeChecker.vapply(TreeChecker.java:348)
        [..]
what expected no runtime error!
[back to overview]
Changes of this bug report
Philippe  edited on  2004-01-05 11:22:02.0

The problem seems to be somewhere in the Analyzer. The expression Foo(0) is translated into the expression new Foo(0) but with the wrong symbol. It seems that it refers the constructor of some compound type instead of the contructor of class Foo.

Martin  edited on  2004-01-05 13:03:51.0