Support Infinity and NaN in constant evaluator
This allows to store infinities and NaNs inside const vals
This commit is contained in:
+4
-1
@@ -455,7 +455,10 @@ private class ConstantExpressionEvaluatorVisitor(
|
||||
if (isDivisionByZero(resultingDescriptorName.asString(), argumentForParameter.value)) {
|
||||
val parentExpression: KtExpression = PsiTreeUtil.getParentOfType(receiverExpression, KtExpression::class.java)!!
|
||||
trace.report(Errors.DIVISION_BY_ZERO.on(parentExpression))
|
||||
return factory.createErrorValue("Division by zero").wrap()
|
||||
|
||||
if (isIntegerType(argumentForReceiver.value) && isIntegerType(argumentForParameter.value)) {
|
||||
return factory.createErrorValue("Division by zero").wrap()
|
||||
}
|
||||
}
|
||||
|
||||
val result = evaluateBinaryAndCheck(argumentForReceiver, argumentForParameter, resultingDescriptorName.asString(), callExpression) ?: return null
|
||||
|
||||
Reference in New Issue
Block a user