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

Closures behave differently on ++int and int++

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

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.6
    • None
    • syntax
    • None
    • Mac OS X

    Description

      Here is what I've got on 1.6:

      [1,2,3].collect

      {n -> ++n}

      returns as expected [2,3,4]

      and

      [1,2,3].collect

      {n -> n++}

      returns [1,2,3]

      I cannot believe this is not a bug.

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            kyrill007 Kyrill Alyoshin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment