From 00b44c1e68a7f29b953a4d48a5b06c495e0630b7 Mon Sep 17 00:00:00 2001 From: Nicolay Mitropolsky Date: Mon, 27 Apr 2020 21:09:41 +0300 Subject: [PATCH] Uast: making `KotlinStringTemplateUPolyadicExpression.operands` always non-empty (EA-231393) --- ...KotlinStringTemplateUPolyadicExpression.kt | 2 +- .../testData/ParametersDisorder.log-ide.txt | 3 +- .../testData/ParametersDisorder.log.txt | 3 +- .../testData/StringTemplateComplex.kt | 2 + .../testData/StringTemplateComplex.log.txt | 5 ++ .../testData/StringTemplateComplex.render.txt | 2 + .../testData/StringTemplateComplex.types.txt | 5 ++ .../testData/StringTemplateComplex.values.txt | 85 +++++++++++++++++++ .../StringTemplateComplexForUInjectionHost.kt | 2 + ...ngTemplateComplexForUInjectionHost.log.txt | 5 ++ ...emplateComplexForUInjectionHost.render.txt | 2 + .../UnexpectedContainerException.log-ide.txt | 3 +- .../UnexpectedContainerException.log.txt | 3 +- .../UnexpectedContainerException.types.txt | 3 +- .../tests/KotlinUastResolveApiTest.kt | 8 +- .../uast-kotlin/tests/KotlinUastValuesTest.kt | 3 + 16 files changed, 126 insertions(+), 10 deletions(-) create mode 100644 plugins/uast-kotlin/testData/StringTemplateComplex.values.txt diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinStringTemplateUPolyadicExpression.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinStringTemplateUPolyadicExpression.kt index 0c78d3489f6..6e518421b2c 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinStringTemplateUPolyadicExpression.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinStringTemplateUPolyadicExpression.kt @@ -36,7 +36,7 @@ class KotlinStringTemplateUPolyadicExpression( this, DEFAULT_EXPRESSION_TYPES_LIST )!! - } + }.takeIf { it.isNotEmpty() } ?: listOf(KotlinStringULiteralExpression(sourcePsi, this, "")) } override val operator = UastBinaryOperator.PLUS diff --git a/plugins/uast-kotlin/testData/ParametersDisorder.log-ide.txt b/plugins/uast-kotlin/testData/ParametersDisorder.log-ide.txt index c31359514ce..1180ec3dc49 100644 --- a/plugins/uast-kotlin/testData/ParametersDisorder.log-ide.txt +++ b/plugins/uast-kotlin/testData/ParametersDisorder.log-ide.txt @@ -124,7 +124,8 @@ UFile (package = ) ULiteralExpression (value = "%i %i %i") UQualifiedReferenceExpression UQualifiedReferenceExpression - UPolyadicExpression (value = "") + UPolyadicExpression (operator = +) + ULiteralExpression (value = "") UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier (chunked)) USimpleNameReferenceExpression (identifier = chunked, resolvesTo = null) diff --git a/plugins/uast-kotlin/testData/ParametersDisorder.log.txt b/plugins/uast-kotlin/testData/ParametersDisorder.log.txt index 890b37dc6d8..09db7541e93 100644 --- a/plugins/uast-kotlin/testData/ParametersDisorder.log.txt +++ b/plugins/uast-kotlin/testData/ParametersDisorder.log.txt @@ -124,7 +124,8 @@ UFile (package = ) ULiteralExpression (value = "%i %i %i") UQualifiedReferenceExpression UQualifiedReferenceExpression - UPolyadicExpression (value = "") + UPolyadicExpression (operator = +) + ULiteralExpression (value = "") UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier (chunked)) USimpleNameReferenceExpression (identifier = chunked, resolvesTo = null) diff --git a/plugins/uast-kotlin/testData/StringTemplateComplex.kt b/plugins/uast-kotlin/testData/StringTemplateComplex.kt index 5f4748f3f3a..7a45d83dbd2 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplex.kt +++ b/plugins/uast-kotlin/testData/StringTemplateComplex.kt @@ -8,6 +8,8 @@ val literalInLiteral = "a ${"literal$case4"} z" val literalInLiteral2 = "a ${"literal$case4".repeat(4)} z" +val empty = "" + fun simpleForTemplate(i: Int = 0) = "$i" fun foo() { diff --git a/plugins/uast-kotlin/testData/StringTemplateComplex.log.txt b/plugins/uast-kotlin/testData/StringTemplateComplex.log.txt index 70bc02526cb..e8a7e234744 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplex.log.txt +++ b/plugins/uast-kotlin/testData/StringTemplateComplex.log.txt @@ -45,11 +45,16 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) ULiteralExpression (value = 4) ULiteralExpression (value = " z") + UField (name = empty) + UAnnotation (fqName = org.jetbrains.annotations.NotNull) + UPolyadicExpression (operator = +) + ULiteralExpression (value = "") UMethod (name = getMuchRecur) UMethod (name = getCase4) UMethod (name = getCase5) UMethod (name = getLiteralInLiteral) UMethod (name = getLiteralInLiteral2) + UMethod (name = getEmpty) UMethod (name = simpleForTemplate) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) diff --git a/plugins/uast-kotlin/testData/StringTemplateComplex.render.txt b/plugins/uast-kotlin/testData/StringTemplateComplex.render.txt index 424902274f7..d85c31e2092 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplex.render.txt +++ b/plugins/uast-kotlin/testData/StringTemplateComplex.render.txt @@ -4,11 +4,13 @@ public final class StringTemplateComplexKt { @org.jetbrains.annotations.NotNull private static final var case5: java.lang.String = "a " + "literal" + " " + "literal" + " z" @org.jetbrains.annotations.NotNull private static final var literalInLiteral: java.lang.String = "a " + "literal" + case4 + " z" @org.jetbrains.annotations.NotNull private static final var literalInLiteral2: java.lang.String = "a " + "literal" + case4.repeat(4) + " z" + @org.jetbrains.annotations.NotNull private static final var empty: java.lang.String = "" public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression public static final fun getCase4() : java.lang.String = UastEmptyExpression public static final fun getCase5() : java.lang.String = UastEmptyExpression public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression + public static final fun getEmpty() : java.lang.String = UastEmptyExpression public static final fun simpleForTemplate(@org.jetbrains.annotations.NotNull i: int) : java.lang.String { return i } diff --git a/plugins/uast-kotlin/testData/StringTemplateComplex.types.txt b/plugins/uast-kotlin/testData/StringTemplateComplex.types.txt index 5e1914e0d2f..195832288ee 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplex.types.txt +++ b/plugins/uast-kotlin/testData/StringTemplateComplex.types.txt @@ -45,11 +45,16 @@ UFile (package = ) [public final class StringTemplateComplexKt {...] USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) [repeat] : PsiType:String ULiteralExpression (value = 4) [4] : PsiType:int ULiteralExpression (value = " z") [" z"] : PsiType:String + UField (name = empty) [@org.jetbrains.annotations.NotNull private static final var empty: java.lang.String = ""] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) [""] : PsiType:String + ULiteralExpression (value = "") [""] : PsiType:String UMethod (name = getMuchRecur) [public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression] UMethod (name = getCase4) [public static final fun getCase4() : java.lang.String = UastEmptyExpression] UMethod (name = getCase5) [public static final fun getCase5() : java.lang.String = UastEmptyExpression] UMethod (name = getLiteralInLiteral) [public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression] UMethod (name = getLiteralInLiteral2) [public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression] + UMethod (name = getEmpty) [public static final fun getEmpty() : java.lang.String = UastEmptyExpression] UMethod (name = simpleForTemplate) [public static final fun simpleForTemplate(@org.jetbrains.annotations.NotNull i: int) : java.lang.String {...}] UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int = 0] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] diff --git a/plugins/uast-kotlin/testData/StringTemplateComplex.values.txt b/plugins/uast-kotlin/testData/StringTemplateComplex.values.txt new file mode 100644 index 00000000000..78490ce39d3 --- /dev/null +++ b/plugins/uast-kotlin/testData/StringTemplateComplex.values.txt @@ -0,0 +1,85 @@ +UFile (package = ) [public final class StringTemplateComplexKt {...] + UClass (name = StringTemplateComplexKt) [public final class StringTemplateComplexKt {...}] + UField (name = muchRecur) [@org.jetbrains.annotations.NotNull private static final var muchRecur: java.lang.String = "abc"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["abc"] = "abc" + UPolyadicExpression (operator = +) ["abc"] = "abc" + UPolyadicExpression (operator = +) ["abc"] = "abc" + UPolyadicExpression (operator = +) ["abc"] = "abc" + ULiteralExpression (value = "abc") ["abc"] = "abc" + UField (name = case4) [@org.jetbrains.annotations.NotNull private static final var case4: java.lang.String = "a " + "literal" + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + " z"] = "a literal z" + ULiteralExpression (value = "a ") ["a "] = "a " + UPolyadicExpression (operator = +) ["literal"] = "literal" + ULiteralExpression (value = "literal") ["literal"] = "literal" + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = case5) [@org.jetbrains.annotations.NotNull private static final var case5: java.lang.String = "a " + "literal" + " " + "literal" + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + " " + "literal" + " z"] = "a literal literal z" + ULiteralExpression (value = "a ") ["a "] = "a " + UPolyadicExpression (operator = +) ["literal"] = "literal" + ULiteralExpression (value = "literal") ["literal"] = "literal" + ULiteralExpression (value = " ") [" "] = " " + UPolyadicExpression (operator = +) ["literal"] = "literal" + ULiteralExpression (value = "literal") ["literal"] = "literal" + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = literalInLiteral) [@org.jetbrains.annotations.NotNull private static final var literalInLiteral: java.lang.String = "a " + "literal" + case4 + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + case4 + " z"] = Undetermined + ULiteralExpression (value = "a ") ["a "] = "a " + UPolyadicExpression (operator = +) ["literal" + case4] = Undetermined + ULiteralExpression (value = "literal") ["literal"] = "literal" + USimpleNameReferenceExpression (identifier = case4) [case4] = external case4() + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = literalInLiteral2) [@org.jetbrains.annotations.NotNull private static final var literalInLiteral2: java.lang.String = "a " + "literal" + case4.repeat(4) + " z"] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) ["a " + "literal" + case4.repeat(4) + " z"] = Undetermined + ULiteralExpression (value = "a ") ["a "] = "a " + UQualifiedReferenceExpression ["literal" + case4.repeat(4)] = external repeat(4)(4) + UPolyadicExpression (operator = +) ["literal" + case4] = Undetermined + ULiteralExpression (value = "literal") ["literal"] = "literal" + USimpleNameReferenceExpression (identifier = case4) [case4] = external case4() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [repeat(4)] = external repeat(4)(4) + UIdentifier (Identifier (repeat)) [UIdentifier (Identifier (repeat))] + USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) [repeat] = external repeat(4)(4) + ULiteralExpression (value = 4) [4] = 4 + ULiteralExpression (value = " z") [" z"] = " z" + UField (name = empty) [@org.jetbrains.annotations.NotNull private static final var empty: java.lang.String = ""] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + UPolyadicExpression (operator = +) [""] = "" + ULiteralExpression (value = "") [""] = "" + UMethod (name = getMuchRecur) [public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase4) [public static final fun getCase4() : java.lang.String = UastEmptyExpression] + UMethod (name = getCase5) [public static final fun getCase5() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral) [public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression] + UMethod (name = getLiteralInLiteral2) [public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression] + UMethod (name = getEmpty) [public static final fun getEmpty() : java.lang.String = UastEmptyExpression] + UMethod (name = simpleForTemplate) [public static final fun simpleForTemplate(@org.jetbrains.annotations.NotNull i: int) : java.lang.String {...}] + UParameter (name = i) [@org.jetbrains.annotations.NotNull var i: int = 0] + UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] + ULiteralExpression (value = 0) [0] = 0 + UBlockExpression [{...}] = Nothing + UReturnExpression [return i] = Nothing + UPolyadicExpression (operator = +) [i] = Undetermined + USimpleNameReferenceExpression (identifier = i) [i] = Undetermined + UMethod (name = foo) [public static final fun foo() : void {...}] + UBlockExpression [{...}] = Undetermined + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(baz)] = external println(baz)(external baz()) + UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))] + USimpleNameReferenceExpression (identifier = println, resolvesTo = null) [println] = external println(baz)(external baz()) + UPolyadicExpression (operator = +) [baz] = external baz() + USimpleNameReferenceExpression (identifier = baz) [baz] = external baz() + UDeclarationsExpression [var template1: java.lang.String = simpleForTemplate()] = Undetermined + ULocalVariable (name = template1) [var template1: java.lang.String = simpleForTemplate()] + UPolyadicExpression (operator = +) [simpleForTemplate()] = external simpleForTemplate()() + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] = external simpleForTemplate()() + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] = external simpleForTemplate()() + UDeclarationsExpression [var template2: java.lang.String = "." + simpleForTemplate()] = Undetermined + ULocalVariable (name = template2) [var template2: java.lang.String = "." + simpleForTemplate()] + UPolyadicExpression (operator = +) ["." + simpleForTemplate()] = Undetermined + ULiteralExpression (value = ".") ["."] = "." + UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [simpleForTemplate()] = external simpleForTemplate()() + UIdentifier (Identifier (simpleForTemplate)) [UIdentifier (Identifier (simpleForTemplate))] + USimpleNameReferenceExpression (identifier = simpleForTemplate, resolvesTo = null) [simpleForTemplate] = external simpleForTemplate()() diff --git a/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.kt b/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.kt index 5f4748f3f3a..7a45d83dbd2 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.kt +++ b/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.kt @@ -8,6 +8,8 @@ val literalInLiteral = "a ${"literal$case4"} z" val literalInLiteral2 = "a ${"literal$case4".repeat(4)} z" +val empty = "" + fun simpleForTemplate(i: Int = 0) = "$i" fun foo() { diff --git a/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.log.txt b/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.log.txt index 055e30ab4ff..69e3a278e86 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.log.txt +++ b/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.log.txt @@ -45,11 +45,16 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = repeat, resolvesTo = null) ULiteralExpression (value = 4) ULiteralExpression (value = " z") + UField (name = empty) + UAnnotation (fqName = org.jetbrains.annotations.NotNull) + UPolyadicExpression (operator = +) + ULiteralExpression (value = "") UMethod (name = getMuchRecur) UMethod (name = getCase4) UMethod (name = getCase5) UMethod (name = getLiteralInLiteral) UMethod (name = getLiteralInLiteral2) + UMethod (name = getEmpty) UMethod (name = simpleForTemplate) UParameter (name = i) UAnnotation (fqName = org.jetbrains.annotations.NotNull) diff --git a/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.render.txt b/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.render.txt index c6ab7798351..100664c9e49 100644 --- a/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.render.txt +++ b/plugins/uast-kotlin/testData/StringTemplateComplexForUInjectionHost.render.txt @@ -4,11 +4,13 @@ public final class StringTemplateComplexForUInjectionHostKt { @org.jetbrains.annotations.NotNull private static final var case5: java.lang.String = "a " + "literal" + " " + "literal" + " z" @org.jetbrains.annotations.NotNull private static final var literalInLiteral: java.lang.String = "a " + "literal" + case4 + " z" @org.jetbrains.annotations.NotNull private static final var literalInLiteral2: java.lang.String = "a " + "literal" + case4.repeat(4) + " z" + @org.jetbrains.annotations.NotNull private static final var empty: java.lang.String = "" public static final fun getMuchRecur() : java.lang.String = UastEmptyExpression public static final fun getCase4() : java.lang.String = UastEmptyExpression public static final fun getCase5() : java.lang.String = UastEmptyExpression public static final fun getLiteralInLiteral() : java.lang.String = UastEmptyExpression public static final fun getLiteralInLiteral2() : java.lang.String = UastEmptyExpression + public static final fun getEmpty() : java.lang.String = UastEmptyExpression public static final fun simpleForTemplate(@org.jetbrains.annotations.NotNull i: int) : java.lang.String { return i } diff --git a/plugins/uast-kotlin/testData/UnexpectedContainerException.log-ide.txt b/plugins/uast-kotlin/testData/UnexpectedContainerException.log-ide.txt index 370f70a78ff..f5a6d6985c9 100644 --- a/plugins/uast-kotlin/testData/UnexpectedContainerException.log-ide.txt +++ b/plugins/uast-kotlin/testData/UnexpectedContainerException.log-ide.txt @@ -36,5 +36,6 @@ UFile (package = ) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (UnsupportedOperationException)) USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) - UPolyadicExpression (value = "") + UPolyadicExpression (operator = +) + ULiteralExpression (value = "") UMethod (name = ) diff --git a/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt b/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt index 57c397a0009..35eacfcab7d 100644 --- a/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt +++ b/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt @@ -36,5 +36,6 @@ UFile (package = ) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (UnsupportedOperationException)) USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) - UPolyadicExpression (value = "") + UPolyadicExpression (operator = +) + ULiteralExpression (value = "") UMethod (name = Model$1$1) diff --git a/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt b/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt index 2e498cbe727..8a368df31cc 100644 --- a/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt +++ b/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt @@ -36,5 +36,6 @@ UFile (package = ) [public abstract interface Callback {...] UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [("")] : PsiType:UnsupportedOperationException UIdentifier (Identifier (UnsupportedOperationException)) [UIdentifier (Identifier (UnsupportedOperationException))] USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) [] : PsiType:UnsupportedOperationException - UPolyadicExpression (value = "") [""] : PsiType:String + UPolyadicExpression (operator = +) [""] : PsiType:String + ULiteralExpression (value = "") [""] : PsiType:String UMethod (name = Model$1$1) [fun Model$1$1() = UastEmptyExpression] diff --git a/plugins/uast-kotlin/tests/KotlinUastResolveApiTest.kt b/plugins/uast-kotlin/tests/KotlinUastResolveApiTest.kt index d9a84815617..49a1d281327 100644 --- a/plugins/uast-kotlin/tests/KotlinUastResolveApiTest.kt +++ b/plugins/uast-kotlin/tests/KotlinUastResolveApiTest.kt @@ -79,7 +79,7 @@ class KotlinUastResolveApiTest : KotlinLightCodeInsightFixtureTestCase() { "s.kt", """ fun main(args: Array) { - System.out.print("" + System.out.print("1" } """ ) @@ -103,7 +103,7 @@ class KotlinUastResolveApiTest : KotlinLightCodeInsightFixtureTestCase() { TestCase.assertEquals(PsiType.VOID, functionCall.getExpressionType()) - val firstArgument = main.findElementByText("\"\"") + val firstArgument = main.findElementByText("\"1\"") val firstParameter = functionCall.getArgumentForParameter(0) TestCase.assertEquals(firstArgument, firstParameter) } @@ -124,7 +124,7 @@ class KotlinUastResolveApiTest : KotlinLightCodeInsightFixtureTestCase() { "s.kt", """ fun main(args: Array) { - JavaClass().setParameter("" + JavaClass().setParameter("1" } """ ) @@ -144,7 +144,7 @@ class KotlinUastResolveApiTest : KotlinLightCodeInsightFixtureTestCase() { TestCase.assertEquals(PsiType.VOID, functionCall.getExpressionType()) - val firstArgument = main.findElementByText("\"\"") + val firstArgument = main.findElementByText("\"1\"") val firstParameter = functionCall.getArgumentForParameter(0) TestCase.assertEquals(firstArgument, firstParameter) } diff --git a/plugins/uast-kotlin/tests/KotlinUastValuesTest.kt b/plugins/uast-kotlin/tests/KotlinUastValuesTest.kt index eadbe06a59c..570ad59b4a1 100644 --- a/plugins/uast-kotlin/tests/KotlinUastValuesTest.kt +++ b/plugins/uast-kotlin/tests/KotlinUastValuesTest.kt @@ -18,4 +18,7 @@ class KotlinUastValuesTest : AbstractKotlinValuesTest() { @Test fun testSimple() = doTest("Simple") + + @Test + fun testStringTemplateComplex() = doTest("StringTemplateComplex") } \ No newline at end of file