Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-6089

type function: Unit type being returned for empty array and hash

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • PUP 4.4.0
    • PUP 4.4.2
    • None
    • None
    • 1
    • Language 2016-04-20
    • Bug Fix
    • Hide
      The notation for empty Array and Hash were earlier unspecified and the output showed internal details related to the implementation of the Puppet Type System. Empty Array is now displayed as Array[0, 0], and an empty Hash as Hash[0, 0]. In conjunction with this change, it is now also illegal to specify an element (or key/value) type when also specifying empty - i.e. Array[Integer, 0, 0] is now illegal.
      Show
      The notation for empty Array and Hash were earlier unspecified and the output showed internal details related to the implementation of the Puppet Type System. Empty Array is now displayed as Array[0, 0], and an empty Hash as Hash[0, 0]. In conjunction with this change, it is now also illegal to specify an element (or key/value) type when also specifying empty - i.e. Array[Integer, 0, 0] is now illegal.

    Description

      The following manifest:

      notice(type([]))
      notice(type({}))
      

      produces the following output:

      Notice: Scope(Class[main]): Array[Unit, 0, 0]
      Notice: Scope(Class[main]): Hash[Unit, Unit, 0, 0]
      

      Unit is not part of the Puppet type system and should not be displayed.

      Expected output:

      Notice: Scope(Class[main]): Array[Any, 0, 0]
      Notice: Scope(Class[main]): Hash[Any, Any, 0, 0]
      

      ACCEPTANCE CRITERIA


      notice(type([]), type({}))
      

      Should produce:

      Notice: Scope(Class[main]): Array[0, 0] Hash[0, 0]
      

      And it is illegal to create an empty typed container:

      • Array[Integer, 0, 0]
      • Hash[Integer, Integer, 0, 0]

      Attachments

        Issue Links

          Activity

            People

              john.duarte John Duarte
              peter.huene Peter Huene
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support