remove unnecessary restrictions on array indices

This commit is contained in:
Dmitry Jemerov
2011-07-14 19:04:06 +02:00
parent 0a9c626f21
commit 385f8267fa
@@ -1506,13 +1506,9 @@ public class ExpressionCodegen extends JetVisitor {
private void generateArrayIndex(JetArrayAccessExpression expression) {
final List<JetExpression> indices = expression.getIndexExpressions();
if (indices.size() != 1) {
throw new UnsupportedOperationException("array access with more than one index is not supported");
for (JetExpression index : indices) {
gen(index, Type.INT_TYPE);
}
if (!expressionType(indices.get(0)).equals(Type.INT_TYPE)) {
throw new UnsupportedOperationException("array access with non-integer is not supported");
}
gen(indices.get(0), Type.INT_TYPE);
}
@Override