WeaselCompilerReturn wcr = ((WeaselTree)o).compile(compiler, compilerHelper, null, arrayClass, null, false);
if(!wcr.getReturnType().canCastTo(arrayClass))
throw new WeaselCompilerException(token.line, "Can't cast %s to %s", wcr.getReturnType(), arrayClass);
instructions.addAll(wcr.getInstructions());
}
instructions.add(token.line, new WeaselInstructionPush(2));
instructions.add(token.line, new WeaselInstructionLoadConstInteger(i));
instructions.add(token.line, new WeaselInstructionWriteIndex(WeaselPrimitive.getPrimitiveID(arrayClass.getBaseClass())));
}
return instructions;
}