From 9fb09e62afaa00521fb4d3199f17d444d58b8da1 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Wed, 3 Sep 2014 12:15:16 +0400 Subject: [PATCH] toString() on nullables fixed --- .../jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt | 2 +- .../jetbrains/jet/evaluate/AbstractEvaluateExpressionTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 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 261705e0ee9..9b4bb19f6b4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt @@ -554,7 +554,7 @@ private fun createStringConstant(value: CompileTimeConstant<*>?): StringValue? { is CharValue, is DoubleValue, is FloatValue, is BooleanValue, - is NullValue -> StringValue(value.getValue().toString(), value.canBeUsedInAnnotations(), value.usesVariableAsConstant()) + is NullValue -> StringValue("${value.getValue()}", value.canBeUsedInAnnotations(), value.usesVariableAsConstant()) else -> null } } diff --git a/compiler/tests/org/jetbrains/jet/evaluate/AbstractEvaluateExpressionTest.kt b/compiler/tests/org/jetbrains/jet/evaluate/AbstractEvaluateExpressionTest.kt index 77bca56722d..a7eaac8c61f 100644 --- a/compiler/tests/org/jetbrains/jet/evaluate/AbstractEvaluateExpressionTest.kt +++ b/compiler/tests/org/jetbrains/jet/evaluate/AbstractEvaluateExpressionTest.kt @@ -43,7 +43,7 @@ public abstract class AbstractEvaluateExpressionTest : AbstractAnnotationDescrip if (compileTimeConstant is StringValue) { "\\\"${compileTimeConstant.getValue()}\\\"" } else { - compileTimeConstant.toString() + "$compileTimeConstant" } } }