Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
This script:
import groovy.transform.* @CompileStatic class Demo { @IndexedProperty List<Integer> foo @IndexedProperty String[] bar @IndexedProperty List baz } def d = new Demo() d.foo = [11, 22, 33] d.setFoo(0, 100) d.setFoo(1, 200) assert d.foo == [100, 200, 33] assert d.getFoo(1) == 200 d.bar = ['cat'] d.setBar(0, 'dog') assert d.getBar(0) == 'dog' d.baz = ['cat'] d.setBaz(0, 'dog') assert d.getBaz(0) == 'dog'
gives:
BUG! exception in phase 'class generation' in source unit 'ConsoleScript4' At line -1 column -1 On receiver: foo with message: getAt and arguments: index This method should not have been called. Please try to create a simple example reproducing this error and filea bug report at http://jira.codehaus.org/browse/GROOVY at org.codehaus.groovy.classgen.asm.sc.StaticTypesCallSiteWriter.makeSingleArgumentCall(StaticTypesCallSiteWriter.java:558) ... at org.codehaus.groovy.classgen.AsmClassGenerator.visitReturnStatement(AsmClassGenerator.java:560) ...