GROOVY-5306 (https://issues.apache.org/jira/browse/GROOVY-5306) states:

Add "a ?= 2" support: should be expanded to "a = a == null ? 2 : a"

Shouldn't the expansion be "a = (a != null ? a : 2)"?  Like other ternary 
situations, the alternative would not be evaluated unless needed.  Also, is it 
a null check and not Groovy truth in the condition?

If "a" is not null in this example, does the bytecode actually execute an 
assignment?  That seems unnecessary as well.

Reply via email to