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

use statement has no return value

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.5
    • None
    • None

    Description

      Currently use statement returns nothing, even if "return " is explicitly written inside the "use" block. When a value needs to be returned, a workaround like the following has to be put into place:

      def f(){
      def result
      use(...)

      { .... result = ... }

      return result
      }

      Reason being that the return type of GroovyCategorySupport.use() method is void.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            ajoo benyu benyu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment