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

Injected parameter results in omission of block parameter

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Done
    • None
    • PUP 3.7.5
    • Language
    • None
    • 1
    • Language 2015-02-04, Language 2015-02-18

    Description

      An InternalFunction declared with the following dispatch:

      Puppet::Functions.create_function('test', Puppet::Functions::InternalFunction) do
            dispatch :test do
              scope_param
              param 'Integer', 'x'
              required_block_param
            end
            def test(scope, x, block)
              nil
            end
          end
      

      will always fail with 'wrong number of arguments (2 for 3)' when called. The probable cause is that the block parameter is never added to the weaving array. The resulting array after weaving thus contains the scope and the parameter, not the block.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              thomas.hallgren Thomas Hallgren
              Eric Thompson Eric Thompson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support