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

(PR puppet/1710) (#21252) Fix problems with false/nil args and returns in lambda

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
    • Template:

      Description

      Pull Request
      ====
      The issue 21252 was triggered by a documentation error but should
      have produced a different result than the error that was presented.

      This was caused by a series of problems. It was not possible to
      pass `false` as a parameter value as this was taken as missing parameter
      value.

      Also, it was not possible to return the value `false` as this was
      translated to `nil` due to defective work around for missing initialized
      variable on return.

      The fix changes the handling of making sure that the variable that is
      returned exists (by setting value explicelty to `nil` before the start
      of the exception handling block.

      This commit also modifies how a lambda call matches arguments to
      parameters and checks what is missing (now with `false` as a valid value
      in mind).

      A test is added to `collect` that checks that a value of `false` can
      both be passed and returned.

        Attachments

          Activity

            People

            Assignee:
            eric.sorenson Eric Sorenson
            Reporter:
            joshua.partlow Joshua Partlow
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 4 hours
                  4h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified