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

Currying a Writable closure results in a non writable closure

    XMLWordPrintableJSON

Details

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

    Description

      def c1=

      {one, two, out -> out << "$one, $two\n"}

      .asWritable()
      def c2 = c1.curry(1, 2)

      c2(System.out)
      System.out << c2.asWritable()
      System.out << c2

      prints:
      1, 2
      1, 2
      org.codehaus.groovy.runtime.CurriedClosure@f6ac0b

      this denonstrates that the call to curry() on c1 removes the Writable interface

      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: