This ticket is about Puppet Type internals and what's proposed here does not affect how the types are declared or represented.
In the current implementation, the Collection type has both a size_type and an element_type attribute. This, despite the fact that only the size_type is present in the specification. The element_type cannot be declared as a parameter and it is also never included in the string representation of the type. The only reason for it being present in the Collection is to provide some common functionality shared between the Array element_type and the Hash value_type.
The current design has several negative consequences.
- The code is unclean. It's hard to understand why and when the element_type is significant in the Collection type logic.
- It makes the Collection type carry an unnecessary attribute.
- It imposes the name element_type on the Hash type although the name there really should be value_type (to correspond with key_type).
- It has a negative impact on serialization of the Collection type since special logic must be added to understand that the element_type shouldn't be included. This must be fixed (hence the bug status rather than improvement in this ticket).