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

Insufficient error message when erroneously passing a Collection containing non-Data values for a Data parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Normal
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Language, Type System
    • Labels:
      None
    • Template:
    • Sub-team:
    • Team:
      Froyo
    • QA Risk Assessment:
      Needs Assessment

      Description

      Sample code:

      function foo (
        Data $var,
      ) {
        notice($var)
      }
       
      foo([Resource[file]])
      

      produces the output

      Error: Evaluation Error: Error while evaluating a Function Call, 'foo' parameter 'var' expects a Data value, got Tuple at data_type_error.pp:7:1 on node example.com
      

      It's not obvious why that's invalid, because a Tuple can match Data, but only if all its elements match Data.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            lexa Lexa Whitehurst
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Zendesk Support