From 75a8699467ce6d8ee9bed9ff9b48b6db67e7b3e9 Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Wed, 29 Oct 2014 13:25:29 +0300 Subject: [PATCH] Minor: fix warnings --- .../jet/lang/evaluate/ConstantExpressionEvaluator.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt b/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt index 0c2364b99f3..1ccf55d3fa5 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt @@ -167,8 +167,8 @@ public class ConstantExpressionEvaluator private (val trace: BindingTrace) : Jet if (leftValue !is Boolean || rightValue !is Boolean) return null val result = when(operationToken) { - JetTokens.ANDAND -> leftValue as Boolean && rightValue as Boolean - JetTokens.OROR -> leftValue as Boolean || rightValue as Boolean + JetTokens.ANDAND -> leftValue && rightValue + JetTokens.OROR -> leftValue || rightValue else -> throw IllegalArgumentException("Unknown boolean operation token ${operationToken}") } val usesVariableAsConstant = leftConstant.usesVariableAsConstant() || rightConstant.usesVariableAsConstant() @@ -523,7 +523,7 @@ private fun createCompileTimeConstantForEquals(result: Any?, operationReference: JetTokens.EQEQ -> BooleanValue(result, c.canBeUsedInAnnotation, c.usesVariableAsConstant) JetTokens.EXCLEQ -> BooleanValue(!result, c.canBeUsedInAnnotation, c.usesVariableAsConstant) JetTokens.IDENTIFIER -> { - assert ((operationReference as JetSimpleNameExpression).getReferencedNameAsName() == OperatorConventions.EQUALS, "This method should be called only for equals operations") + assert (operationReference.getReferencedNameAsName() == OperatorConventions.EQUALS, "This method should be called only for equals operations") return BooleanValue(result, c.canBeUsedInAnnotation, c.usesVariableAsConstant) } else -> throw IllegalStateException("Unknown equals operation token: $operationToken ${operationReference.getText()}") @@ -542,7 +542,7 @@ private fun createCompileTimeConstantForCompareTo(result: Any?, operationReferen JetTokens.GT -> BooleanValue(result > 0, c.canBeUsedInAnnotation, c.usesVariableAsConstant) JetTokens.GTEQ -> BooleanValue(result >= 0, c.canBeUsedInAnnotation, c.usesVariableAsConstant) JetTokens.IDENTIFIER -> { - assert ((operationReference as JetSimpleNameExpression).getReferencedNameAsName() == OperatorConventions.COMPARE_TO, "This method should be called only for compareTo operations") + assert (operationReference.getReferencedNameAsName() == OperatorConventions.COMPARE_TO, "This method should be called only for compareTo operations") return IntValue(result, c.canBeUsedInAnnotation, c.isPure, c.usesVariableAsConstant) } else -> throw IllegalStateException("Unknown compareTo operation token: $operationToken")