[#405] | project: compiler | priority: low | category: bug | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Philippe | Martin | fixed | 2005-03-07 11:23:26.0 | |
subject | Local objects are incorrectly initialized | |||
code |
object Test with Application { val x = M; object M; assert(x eq M) } |
|||
what happened | Exception in thread "main" java.lang.Error: assertion failed at scala.Predef$.assert(Predef.scala:134) at Test$.-init-(test.scala:5) at Test$.-clinit-(test.scala) at Test.main(test.scala:45) |
|||
what expected | This bug was found by Martin. Here is his comment: This causes an assertion violation at run time. The problem here seems to be that the `M' object is initialized to `null' after `x' has been assigned. Then, in the assert, another `M' object is created. The likely fix is that one should not initialize module objects to null, when they are nested in a class (I think this might be for myself to fix). | |||
[back to overview] |
Martin edited on 2006-03-30 18:19:19.0 |
The problem is fixed in version 2 |