final Statement[] idx = new Statement[this.indexes.length];
for (int i = 0; i < idx.length; i++) {
idx[i] = GenUtil.convert(context, GenUtil.generate(context, this.indexes[i]), MetaClassFactory.get(Integer.class));
}
final VariableReference ref;
try {
ref = context.getVariable(variableName);
} catch (OutOfScopeException e) {
e.initCause(blame);
throw e;
}
if (idx.length > 0) {
if (!ref.getType().isArray()) {
throw new InvalidTypeException("attempt to use indexed accessor on non-array type: " + ref);
}
}
final Statement stmt = new VariableReference() {
@Override
public String getName() {
return ref.getName();
}