[#393] | project: specification | priority: low | category: feature | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Michel | Martin | won't fix | 2005-01-18 11:15:56.0 | |
subject | Classes for nested objects are not in the members of their owner | |||
code |
class C { object O; } |
|||
what happened | The members of |
|||
what expected | The members of C should contain both the class and the instance for the object (as well as the accessor method, but it's already there). |
|||
[back to overview] |
Michel edited on 2005-01-27 15:34:28.0 |
(Background: Martin told me orally that he is not sure this is a bug, because the class should in fact be invisible from outside, hence not part of the members). I have found out that in one situation, the class is in fact part of the members: this happens for objects nested inside of functions, which are later lifted by LambdaLift. So the current behaviour is at least inconsistent, and either LambdaLift or the Analyzer should be changed. To clarify what I mean, here are two examples. In this one, class class Outer { object Nested; } On the other hand, in this example class class Outer { def f = { object Nested; () } } It seems to me that if we want to be really consistent, then classes lifted by LambdaLift should not appear in the members of their host class. But this would cause a number of problems, as some classes would suddenly become invisible to a lot of phases. Maybe all these "invisible" classes should be made private, and renamed to unique names. |
Martin edited on 2006-03-30 18:33:06.0 |
Changed priority to low because it is not a problem right now for Scala 2. I am still now sure what is the correct way of doing this. |
Martin edited on 2006-05-28 21:59:03.0 |
I think this would be a major change of the spec. Right now I don'ty see sufficient reasons to undertake such changes. So I close the bug. |