remove unnecessary restrictions on array indices
This commit is contained in:
@@ -1506,13 +1506,9 @@ public class ExpressionCodegen extends JetVisitor {
|
|||||||
|
|
||||||
private void generateArrayIndex(JetArrayAccessExpression expression) {
|
private void generateArrayIndex(JetArrayAccessExpression expression) {
|
||||||
final List<JetExpression> indices = expression.getIndexExpressions();
|
final List<JetExpression> indices = expression.getIndexExpressions();
|
||||||
if (indices.size() != 1) {
|
for (JetExpression index : indices) {
|
||||||
throw new UnsupportedOperationException("array access with more than one index is not supported");
|
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
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user