Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
1.5.7
-
None
-
None
-
Windows XP SP3, GroovyConsole
Description
On a static final list property, add can be called but not +=. On a static list property both operators work fine.
groovy> class Globals
{ groovy> static final lst = [] groovy> static lst2 = [] groovy> }groovy> Globals.lst2.add(1)
groovy> Globals.lst.add(1)
groovy> Globals.lst2 += 2
groovy> Globals.lst += 2
Exception thrown: groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: lst for class: Globals
groovy.lang.ReadOnlyPropertyException: Cannot set readonly property: lst for class: Globals
at Script8.run(Script8:11)