float/double ranges

This commit is contained in:
Alex Tkachman
2012-01-06 15:55:27 +02:00
parent eba343dd84
commit dba41c2e88
12 changed files with 453 additions and 47 deletions
@@ -30,15 +30,15 @@ public class RangeTo implements IntrinsicMethod {
JetBinaryExpression expression = (JetBinaryExpression) element;
final Type leftType = codegen.expressionType(expression.getLeft());
final Type rightType = codegen.expressionType(expression.getRight());
if (JetTypeMapper.isIntPrimitive(leftType)) {
// if (JetTypeMapper.isIntPrimitive(leftType)) {
codegen.gen(expression.getLeft(), leftType);
codegen.gen(expression.getRight(), rightType);
v.invokestatic("jet/runtime/Ranges", "rangeTo", "(" + leftType.getDescriptor() + rightType.getDescriptor() + ")" + expectedType.getDescriptor());
return StackValue.onStack(expectedType);
}
else {
throw new UnsupportedOperationException("ranges are only supported for int objects");
}
// }
// else {
// throw new UnsupportedOperationException("ranges are only supported for int objects");
// }
}
}
}