Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1099

Changing the delegate ona Curried Closure causes subsiquent calls to fail

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-3
    • 1.0-JSR-4
    • None
    • None

    Description

      c1 =

      {a, b -> println "a= $a b = $b"}

      c2 = c1.curry(1)
      c2(2)
      c2.delegate = null
      c2(3)

      Produces:
      a= 1 b = 2
      Caught: java.lang.NullPointerException
      java.lang.NullPointerException
      at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:306)

      Attachments

        Activity

          People

            tug John Wilson
            tug John Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: