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

List range/collection access inconsistency

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

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.0.8, 2.1.3
    • None
    • groovy-jdk
    • None

    Description

      def l = [0,1,2]
      assert l[0,1,2,3] == [0,1,2,null]
      assert l[0..3] == [0,1,2,null]
      

      the second assertion currently breaks, denoting an inconsistency in the usage of collection indexes vs. ranges.

      Attachments

        Issue Links

        Activity

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

          People

            Unassigned Unassigned
            asteingress Andre Steingress

            Dates

              Created:
              Updated:

              Slack

                Issue deployment