MetaClass referenceType = reference.getType();
final Statement[] indexes = reference.getIndexes();
if (indexes!=null) {
for (final Statement index : indexes) {
if (!referenceType.isArray())
throw new InvalidTypeException("Variable is not a " + indexes.length + "-dimensional array!");
referenceType = referenceType.getComponentType();
}
}
operator.assertCanBeApplied(referenceType);
operator.assertCanBeApplied(statement.getType());