Groovy
  1. Groovy
  2. GROOVY-1287

use(category, closure) should return the closures return value.

    Details

    • Type: Wish Wish
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-5, 1.0-JSR-6
    • Fix Version/s: 1.1-beta-1
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      use(StringCategory) {
      return "hello".capitalize()
      }
      returns null (use is a void method). However a closure call always returns Object. In keeping with the element of least surprise, use() should return the closures return value.

      1. TestUseReturnValue.groovy
        0.5 kB
        Edward Povazan
      2. categoryReturnValuePatch.txt
        4 kB
        Jeff Brown

        Issue Links

          Activity

            People

            • Assignee:
              Jochen Theodorou
              Reporter:
              Edward Povazan
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development