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

Future parser interpolation with [] after variable prefixed with underscore

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: PUP 3.7.5
    • Fix Version/s: PUP 3.8.0, PUP 4.1.0
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2015-04-15
    • Release Notes:
      Bug Fix

      Description

      When a variable containing a hash has a name prefixed with an underscore:

      $_foo = {
        'a' => 'b',
      }
      notify { "${_foo['a']}": }
      

      and run `puppet apply --parser=future` you get the following error:

      Error: Evaluation Error: The value 'a' cannot be converted to Numeric. on node uagent2.corp.puppetlabs.net
      Error: Evaluation Error: The value 'a' cannot be converted to Numeric. on node uagent2.corp.puppetlabs.net
      

      That looks like it might be assuming that the hash is an array?

      The following applies without error:

      $foo = {
        'a' => 'b',
      }
      notify { "${foo['a']}": }
      

      This fails with the future parser on puppet 3.7.5, and also fails against master (at 7ba7ae8f3b221896a3b77beb6778b7a895671c7d)

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  morgan Morgan Rhodes
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  8 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: