Arrays of static types #5338
-
The current draft does not seem to impose any restrictions on the type of array elements. Is it an oversight, or is it supposed to be that way? I came to re-checking the spec after the discussion of static abstract members in interfaces moved to discussing the possibility of allowing static classes as generic arguments. As you can see, it's currently possible to instantiate the array of a static type, but not through normal language means. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
The element type of an array has to be a type, and static classes are (mostly) not considered types:
So I think arrays of static types are forbidden by the spec, and I don't see anything that would need to change here. |
Beta Was this translation helpful? Give feedback.
The element type of an array has to be a type, and static classes are (mostly) not considered types:
So I think arrays of static types are forbidden by the spec, and I don't see anything that would need to change here.