Fix exception on mapping internal types to UAST types with NI
#EA-119071 Fixed
This commit is contained in:
@@ -26,12 +26,10 @@ import org.jetbrains.kotlin.idea.core.copied
|
||||
import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase
|
||||
import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor
|
||||
import org.jetbrains.kotlin.psi.KtCallExpression
|
||||
import org.jetbrains.kotlin.psi.KtClass
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.KtPsiFactory
|
||||
import org.jetbrains.kotlin.psi.psiUtil.findDescendantOfType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getParentOfType
|
||||
import org.jetbrains.kotlin.test.testFramework.runWriteAction
|
||||
import org.jetbrains.uast.*
|
||||
import org.jetbrains.uast.test.env.findUElementByTextFromPsi
|
||||
|
||||
@@ -82,6 +80,26 @@ class KotlinDetachedUastTest : KotlinLightCodeInsightFixtureTestCase() {
|
||||
TestCase.assertNull(uCallExpression.methodName)
|
||||
}
|
||||
|
||||
fun testCapturedTypeInExtensionReceiverOfCall() {
|
||||
val psiFile = myFixture.configureByText(
|
||||
"foo.kt", """
|
||||
class Foo<T>
|
||||
|
||||
fun <K> K.extensionFunc() {}
|
||||
|
||||
fun test(f: Foo<*>) {
|
||||
f.extensionFunc()
|
||||
}
|
||||
""".trimIndent()
|
||||
) as KtFile
|
||||
|
||||
val extensionFunctionCall = psiFile.findDescendantOfType<KtCallExpression>()!!
|
||||
val uCallExpression = extensionFunctionCall.toUElementOfType<UCallExpression>()!!
|
||||
|
||||
TestCase.assertNotNull(uCallExpression.receiverType)
|
||||
TestCase.assertNotNull(uCallExpression.methodName)
|
||||
}
|
||||
|
||||
fun testParameterInAnnotationClassFromFactory() {
|
||||
|
||||
val detachedClass = KtPsiFactory(project).createClass("""
|
||||
|
||||
Reference in New Issue
Block a user