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

Injected parameter results in omission of block parameter

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: PUP 3.7.5
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      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

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  thomas.hallgren Thomas Hallgren
                  QA Contact:
                  Eric Thompson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: