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

          Edward Povazan created issue -
          John Wilson made changes -
          Field Original Value New Value
          Type Bug [ 1 ] Wish [ 5 ]
          Guillaume Delcroix made changes -
          Assignee Guillaume Laforge [ guillaume ]
          Jeff Brown made changes -
          Attachment categoryReturnValuePatch.txt [ 26052 ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.1-beta-1 [ 13164 ]
          Guillaume Delcroix made changes -
          Link This issue is duplicated by GROOVY-1770 [ GROOVY-1770 ]
          Guillaume Delcroix made changes -
          Assignee Jochen Theodorou [ blackdrag ]
          Paul King made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Jeff Brown made changes -
          Link This issue relates to GROOVY-2474 [ GROOVY-2474 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12730430 ] Default workflow, editable Closed status [ 12742425 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12968845 ] Default workflow, editable Closed status [ 12976495 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development