You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/03/02 21:59:00 UTC

[jira] [Resolved] (GROOVY-4875) Add a safe index operator

     [ https://issues.apache.org/jira/browse/GROOVY-4875?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles resolved GROOVY-4875.
---------------------------------
    Fix Version/s: 3.0.0
       Resolution: Fixed

> Add a safe index operator
> -------------------------
>
>                 Key: GROOVY-4875
>                 URL: https://issues.apache.org/jira/browse/GROOVY-4875
>             Project: Groovy
>          Issue Type: Improvement
>          Components: syntax
>            Reporter: Uri Moszkowicz
>            Priority: Minor
>             Fix For: 3.0.0
>
>
> 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]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)