Uast: Fix getExpressionType for elvis expression
#KT-18997 Fixed Target Versions 1.1.5
This commit is contained in:
@@ -7,7 +7,6 @@ import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||
import org.jetbrains.uast.*
|
||||
import org.jetbrains.uast.test.env.findElementByText
|
||||
import org.jetbrains.uast.visitor.UastVisitor
|
||||
import org.junit.Assert
|
||||
import org.junit.Test
|
||||
|
||||
@@ -98,4 +97,11 @@ class KotlinUastApiTest : AbstractKotlinUastTest() {
|
||||
test2.fields.find { it.name == "bar" }!!.annotations.single { it.qualifiedName == "MyAnnotation" }
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun testElvisType() {
|
||||
doTest("ElvisType") { _, file ->
|
||||
val elvisExpression = file.findElementByText<UExpression>("text ?: return")
|
||||
assertEquals("String", elvisExpression.getExpressionType()!!.presentableText)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user