[#416] | project: compiler | priority: low | category: feature | |
---|---|---|---|---|
submitter | assigned to | status | date submitted | |
Michel | Martin | fixed | 2005-04-09 18:10:53.0 | |
subject | Type selection not checked according to the reference | |||
code |
class B[T]; abstract class C { type T; class U extends B[T]; } object Main with Application { val v1: C#U = null; } |
|||
what happened | The compiler accepted the program. |
|||
what expected | An error, since the Scala reference says (ยง3.2.2) the following:
A type projection T#x references the type member named x of type T. T must be either a singleton type, or a non-abstract class type, or a Java class type (in either of the last two cases, it is guaranteed that T has no abstract type members).Here, I can select type U from class C even though it is an abstract class type. |
|||
[back to overview] |
Martin edited on 2006-03-30 17:53:57.0 |
The reference has changed to allow this behavior: A type projection \lstinline@$T$#$x$@ references the type member named $x$ of type $T$. If $x$ references an abstract type member, then $T$ must be a singleton type. |