puppetlabs/puppet — pull request #3361 by hlindberg (2014-12-02 01:15:13+00:00)
Title: (PUP-3680) Remove confusing convenience Hash[value-type]

In an attempt to be helpful, the type system offers a convenience
that if a Hash type is specified with one key, then this is taken
as being the type of the value (and the key type defaults to
Scalar).

In practice this proved to be confusing as it raises the question
about if it is the key type or the value type that is being
specified. Some users thought it was they key type, as that is
what they wanted control over, others thought it was the value type.

From a consistency standpoint (a Hash is a Collection), it could
be viewed as being a collection of Tuple[Key, Value], but implementing
that is not very helpful (it is just more to type). The best solution is
therefore to simply remove the convenience and require both Key and
Value type as a minimum. (This also removes the confusion over the error
if wanting to specify Hash[Value, 2,5] (which fails because 2 is not a
type). Now users have to specify the full type: Hash[Key, Value, 2, 5]
if they want to add min and max entries.