Affects Version/s: 1.0, 1.5, 1.5.1
Fix Version/s: 1.5.3
Number of attachments :
getArray () [ getIndex() ] = 10
Both getArray () and getIndex() called twice.
Barzilai Spinak schrieb:
> Something broke in 1.5.2 and I'm still following the debug trace so hold on for a minute
> (In Eclipse I still have Groovy 1.5.1)
I agree, but following the stack possibly won't help much. because before 1.5.2 a "return a[x]=b" was compiled as
then we changed this to:
and during this change something broke. So while in 1.5.1 you would at some point get into a method call a.getAt, in 1.5.2 you won't. Instead Groovy should have left a copy of b on the stack and used this copy to do the return. And I think that did not happen, so it is a compiler problem, no API problem.
But it is also possible that this uncovered an very old error we have even before 1.0 and that was till now simply hidden by the fact that "return a[x]" was generated.
Alex has fixed this already, so this issue is to capture that fact and this test case for it.