@import java.math.BigDecimal @import java.util.List @import java.util.Map @args(List list, Map map) @* * Collection loop. *@ @for (value : list) { @with (BigDecimal newObject = value.stripTrailingZeros()) { Inside with block, the line below didn't compile. @value.toString() } Outside with block is fine: @value.toString() } @* * Collection loop with iterator. *@ @for ((itr, value) : list) { @with (Integer index = itr.index()) { Inside with block, the lines below didn't compile. @itr.index() @itr.first() @itr.last() } Outside with block is fine: @itr.index() @itr.first() @itr.last() } @* * Indexed loop. Disabled for now, since that requires more changes to the generation. * Currently fails. @for (int i = 0; i < list.size(); i++) { @with (BigDecimal newObject = list.get(i)) { Inside with block, the line below didn't compile. @list.get(i) } Outside with block is fine: @list.get(i) } *@ @* * Enhanced map loop (test on key). *@ @for ((key, value) : map) { @with (String newObject = key.toLowerCase()) { Inside with block, the line below didn't compile. @key.toLowerCase() } Outside with block is fine: @key.toLowerCase() } @* * Enhanced map loop (test on value). *@ @for ((key, value) : map) { @with (BigDecimal newObject = value.stripTrailingZeros()) { Inside with block, the line below didn't compile. @value.stripTrailingZeros() } Outside with block is fine: @value.stripTrailingZeros() } @* * Enhanced map loop (test on iterator). *@ @for ((itr, String key, BigDecimal value) : map) { @with (Integer index = itr.index()) { Inside with block, the lines below didn't compile. @itr.index() @itr.first() @itr.last() } Outside with block is fine: @itr.index() @itr.first() @itr.last() }