groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Sun <>
Subject Safe index for Groovy 3
Date Tue, 08 Nov 2016 16:08:18 GMT
Hi all,

      The new parser supports safe index now, which is proposed by Paul King

      Here are some example code:

assert null == null?[1];
assert null == null?[1]?[1, 2];
assert null == null?[1]?[1, 2]?[1, 2, 3];

def a = null;
assert null == a?[1, 2];

def f() {return null}
assert null == f()?[1];

       More information can be found at the safeIndex branch of

       Any thoughts?

       BTW, the antlr4 branch of apache/groovy is very old, I am going to
try to update it with the master.


View this message in context:
Sent from the Groovy Dev mailing list archive at

View raw message