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

Add a safe index operator

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

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.0
    • syntax
    • None

    Description

      It would be nice if there were a safe navigation operator for subscripts.

      Safe navigation operator:
      a?.b

      Safe index operator:
      a.size() > 0 ? a[0] : null => a?[0]

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            balor123 Uri Moszkowicz
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment