From c93ae6454668c4d94e39aadbac1e8c0ae77d1d5d Mon Sep 17 00:00:00 2001 From: Nicolay Mitropolsky Date: Tue, 25 Aug 2020 15:22:04 +0300 Subject: [PATCH] Uast: `KotlinClassViaConstructorUSimpleReferenceExpression` resolve to `PsiClass` (KT-41290) --- .../KotlinUSimpleReferenceExpression.kt | 18 +++++++++++------- .../testData/AnnotationComplex.log.txt | 8 ++++---- .../uast-kotlin/testData/Anonymous.log-ide.txt | 2 +- plugins/uast-kotlin/testData/Anonymous.log.txt | 2 +- .../testData/ConstructorDelegate.log-ide.txt | 2 +- .../testData/ConstructorDelegate.log.txt | 2 +- .../testData/Constructors.log-ide.txt | 14 +++++++------- .../uast-kotlin/testData/Constructors.log.txt | 14 +++++++------- plugins/uast-kotlin/testData/Delegate.log.txt | 6 +++--- .../uast-kotlin/testData/Delegate.values.txt | 6 +++--- .../testData/LocalDeclarations.log-ide.txt | 6 +++--- .../testData/LocalDeclarations.log.txt | 6 +++--- .../testData/LocalDeclarations.types.txt | 6 +++--- .../testData/LocalDeclarations.values.txt | 6 +++--- .../testData/NonTrivialIdentifiers.log.txt | 2 +- .../testData/ParametersDisorder.log-ide.txt | 2 +- .../testData/ParametersDisorder.log.txt | 2 +- .../testData/QualifiedConstructorCall.log.txt | 2 +- .../uast-kotlin/testData/SimpleScript.log.txt | 2 +- .../testData/SuperCalls.log-ide.txt | 12 ++++++------ .../uast-kotlin/testData/SuperCalls.log.txt | 12 ++++++------ .../uast-kotlin/testData/Suspend.log-ide.txt | 4 ++-- plugins/uast-kotlin/testData/Suspend.log.txt | 2 +- .../UnexpectedContainerException.log-ide.txt | 4 ++-- .../UnexpectedContainerException.log.txt | 4 ++-- .../UnexpectedContainerException.types.txt | 4 ++-- plugins/uast-kotlin/tests/KotlinUastApiTest.kt | 2 +- 27 files changed, 78 insertions(+), 74 deletions(-) diff --git a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUSimpleReferenceExpression.kt b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUSimpleReferenceExpression.kt index 7c5778611fe..233790f0ed3 100644 --- a/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUSimpleReferenceExpression.kt +++ b/plugins/uast-kotlin/src/org/jetbrains/uast/kotlin/expressions/KotlinUSimpleReferenceExpression.kt @@ -16,19 +16,16 @@ package org.jetbrains.uast.kotlin -import com.intellij.psi.PsiClassType -import com.intellij.psi.PsiElement -import com.intellij.psi.PsiMethod -import com.intellij.psi.PsiNamedElement +import com.intellij.psi.* import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.descriptors.ConstructorDescriptor import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.lexer.KtTokens -import org.jetbrains.kotlin.resolve.sam.SamConstructorDescriptor import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.kotlin.resolve.calls.tower.NewResolvedCallImpl +import org.jetbrains.kotlin.resolve.sam.SamConstructorDescriptor import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor import org.jetbrains.uast.* import org.jetbrains.uast.internal.acceptList @@ -177,7 +174,7 @@ class KotlinClassViaConstructorUSimpleReferenceExpression( private val resolved by lazy { when (val resultingDescriptor = sourcePsi.getResolvedCall(sourcePsi.analyze())?.descriptorForResolveViaConstructor()) { is ConstructorDescriptor -> { - sourcePsi.calleeExpression?.let { resolveToDeclaration(it, resultingDescriptor) } + sourcePsi.calleeExpression?.let { resolveToDeclaration(it, resultingDescriptor.constructedClass) } } is SamConstructorDescriptor -> (resultingDescriptor.returnType?.getFunctionalInterfaceType(this, sourcePsi) as? PsiClassType)?.resolve() @@ -191,7 +188,14 @@ class KotlinClassViaConstructorUSimpleReferenceExpression( override fun resolve(): PsiElement? = resolved - override fun asLogString(): String = log("identifier = $identifier, resolvesTo = $resolvedName") + override fun asLogString(): String { + val resolveStr = when(val resolved = resolve()){ + is PsiClass -> "PsiClass: ${resolved.name}" + is PsiMethod -> "PsiMethod: ${resolved.name}" + else -> resolved.toString() + } + return log("identifier = $identifier, resolvesTo = $resolveStr") + } // In new inference, SAM constructor is substituted with a function descriptor, so we use candidate descriptor to preserve behavior private fun ResolvedCall<*>.descriptorForResolveViaConstructor(): CallableDescriptor? { diff --git a/plugins/uast-kotlin/testData/AnnotationComplex.log.txt b/plugins/uast-kotlin/testData/AnnotationComplex.log.txt index 75c68f444ed..9760eb33323 100644 --- a/plugins/uast-kotlin/testData/AnnotationComplex.log.txt +++ b/plugins/uast-kotlin/testData/AnnotationComplex.log.txt @@ -11,14 +11,14 @@ UFile (package = ) UNamedExpression (name = value) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Annotation)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Annotation) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) UMethod (name = B1) UClass (name = B2) UAnnotation (fqName = AnnotationArray) UNamedExpression (name = value) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 2)) UIdentifier (Identifier (Annotation)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Annotation) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) ULiteralExpression (value = "sv1") ULiteralExpression (value = "sv2") UMethod (name = B2) @@ -29,7 +29,7 @@ UFile (package = ) UNamedExpression (name = value) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (Annotation)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Annotation) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 2)) UIdentifier (Identifier (arrayOf)) USimpleNameReferenceExpression (identifier = arrayOf, resolvesTo = null) @@ -41,7 +41,7 @@ UFile (package = ) UNamedExpression (name = value) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (Annotation)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Annotation) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Annotation) UCallExpression (kind = UastCallKind(name='array_initializer'), argCount = 2)) UIdentifier (Identifier ([)) ULiteralExpression (value = "[sar]1") diff --git a/plugins/uast-kotlin/testData/Anonymous.log-ide.txt b/plugins/uast-kotlin/testData/Anonymous.log-ide.txt index 7ce1b45a9d3..295a6fc2dea 100644 --- a/plugins/uast-kotlin/testData/Anonymous.log-ide.txt +++ b/plugins/uast-kotlin/testData/Anonymous.log-ide.txt @@ -20,7 +20,7 @@ UFile (package = ) ULocalVariable (name = runnable2) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier (Runnable)) - USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = Runnable) + USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = PsiClass: Runnable) ULambdaExpression UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) diff --git a/plugins/uast-kotlin/testData/Anonymous.log.txt b/plugins/uast-kotlin/testData/Anonymous.log.txt index 2a142614241..811864d741d 100644 --- a/plugins/uast-kotlin/testData/Anonymous.log.txt +++ b/plugins/uast-kotlin/testData/Anonymous.log.txt @@ -20,7 +20,7 @@ UFile (package = ) ULocalVariable (name = runnable2) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier (Runnable)) - USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = Runnable) + USimpleNameReferenceExpression (identifier = Runnable, resolvesTo = PsiClass: Runnable) ULambdaExpression UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) diff --git a/plugins/uast-kotlin/testData/ConstructorDelegate.log-ide.txt b/plugins/uast-kotlin/testData/ConstructorDelegate.log-ide.txt index 2d91310ba21..49ab9ed547b 100644 --- a/plugins/uast-kotlin/testData/ConstructorDelegate.log-ide.txt +++ b/plugins/uast-kotlin/testData/ConstructorDelegate.log-ide.txt @@ -7,7 +7,7 @@ UFile (package = ) UReturnExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (BaseImpl)) - USimpleNameReferenceExpression (identifier = , resolvesTo = BaseImpl) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: BaseImpl) USimpleNameReferenceExpression (identifier = i) UClass (name = Base) UMethod (name = print) diff --git a/plugins/uast-kotlin/testData/ConstructorDelegate.log.txt b/plugins/uast-kotlin/testData/ConstructorDelegate.log.txt index 8bf1fc9d014..1d753e995ed 100644 --- a/plugins/uast-kotlin/testData/ConstructorDelegate.log.txt +++ b/plugins/uast-kotlin/testData/ConstructorDelegate.log.txt @@ -7,7 +7,7 @@ UFile (package = ) UReturnExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (BaseImpl)) - USimpleNameReferenceExpression (identifier = , resolvesTo = BaseImpl) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: BaseImpl) USimpleNameReferenceExpression (identifier = i) UClass (name = Base) UMethod (name = print) diff --git a/plugins/uast-kotlin/testData/Constructors.log-ide.txt b/plugins/uast-kotlin/testData/Constructors.log-ide.txt index 162a2b9bb57..84fc9fc8821 100644 --- a/plugins/uast-kotlin/testData/Constructors.log-ide.txt +++ b/plugins/uast-kotlin/testData/Constructors.log-ide.txt @@ -12,7 +12,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (this)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) UQualifiedReferenceExpression USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) @@ -36,7 +36,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (this)) - USimpleNameReferenceExpression (identifier = , resolvesTo = AWithInit) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: AWithInit) UQualifiedReferenceExpression USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) @@ -66,7 +66,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (this)) - USimpleNameReferenceExpression (identifier = , resolvesTo = AWith2Init) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: AWith2Init) UQualifiedReferenceExpression USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) @@ -98,7 +98,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier ()) - USimpleNameReferenceExpression (identifier = , resolvesTo = Object) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) UBinaryExpression (operator = =) USimpleNameReferenceExpression (identifier = a) UQualifiedReferenceExpression @@ -112,7 +112,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier ()) - USimpleNameReferenceExpression (identifier = , resolvesTo = Object) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) UBinaryExpression (operator = =) USimpleNameReferenceExpression (identifier = a) USimpleNameReferenceExpression (identifier = s) @@ -129,7 +129,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier ()) - USimpleNameReferenceExpression (identifier = , resolvesTo = Object) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (println)) @@ -147,7 +147,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier ()) - USimpleNameReferenceExpression (identifier = , resolvesTo = Object) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) UBinaryExpression (operator = =) USimpleNameReferenceExpression (identifier = a) USimpleNameReferenceExpression (identifier = s) diff --git a/plugins/uast-kotlin/testData/Constructors.log.txt b/plugins/uast-kotlin/testData/Constructors.log.txt index d2485ac2278..5d57b94b092 100644 --- a/plugins/uast-kotlin/testData/Constructors.log.txt +++ b/plugins/uast-kotlin/testData/Constructors.log.txt @@ -12,7 +12,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (this)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) UQualifiedReferenceExpression USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) @@ -36,7 +36,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (this)) - USimpleNameReferenceExpression (identifier = , resolvesTo = AWithInit) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: AWithInit) UQualifiedReferenceExpression USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) @@ -66,7 +66,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (this)) - USimpleNameReferenceExpression (identifier = , resolvesTo = AWith2Init) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: AWith2Init) UQualifiedReferenceExpression USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) @@ -98,7 +98,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier ()) - USimpleNameReferenceExpression (identifier = , resolvesTo = Object) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) UBinaryExpression (operator = =) USimpleNameReferenceExpression (identifier = a) UQualifiedReferenceExpression @@ -112,7 +112,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier ()) - USimpleNameReferenceExpression (identifier = , resolvesTo = Object) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) UBinaryExpression (operator = =) USimpleNameReferenceExpression (identifier = a) USimpleNameReferenceExpression (identifier = s) @@ -129,7 +129,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier ()) - USimpleNameReferenceExpression (identifier = , resolvesTo = Object) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) UBlockExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (println)) @@ -147,7 +147,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier ()) - USimpleNameReferenceExpression (identifier = , resolvesTo = Object) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Object) UBinaryExpression (operator = =) USimpleNameReferenceExpression (identifier = a) USimpleNameReferenceExpression (identifier = s) diff --git a/plugins/uast-kotlin/testData/Delegate.log.txt b/plugins/uast-kotlin/testData/Delegate.log.txt index 22484ddcf1f..a0b9d104ca6 100644 --- a/plugins/uast-kotlin/testData/Delegate.log.txt +++ b/plugins/uast-kotlin/testData/Delegate.log.txt @@ -27,7 +27,7 @@ UFile (package = ) UReturnExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) UIdentifier (Identifier (MyColor)) - USimpleNameReferenceExpression (identifier = , resolvesTo = MyColor) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) ULiteralExpression (value = 18) ULiteralExpression (value = 2) ULiteralExpression (value = 3) @@ -41,7 +41,7 @@ UFile (package = ) UReturnExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) UIdentifier (Identifier (MyColor)) - USimpleNameReferenceExpression (identifier = , resolvesTo = MyColor) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) ULiteralExpression (value = 1) ULiteralExpression (value = 2) ULiteralExpression (value = 3) @@ -49,7 +49,7 @@ UFile (package = ) UAnnotation (fqName = org.jetbrains.annotations.NotNull) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) UIdentifier (Identifier (MyColor)) - USimpleNameReferenceExpression (identifier = , resolvesTo = MyColor) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) ULiteralExpression (value = 1) ULiteralExpression (value = 2) ULiteralExpression (value = 3) diff --git a/plugins/uast-kotlin/testData/Delegate.values.txt b/plugins/uast-kotlin/testData/Delegate.values.txt index d4d44b917ea..1e2d5bdd844 100644 --- a/plugins/uast-kotlin/testData/Delegate.values.txt +++ b/plugins/uast-kotlin/testData/Delegate.values.txt @@ -31,7 +31,7 @@ UFile (package = ) [public final class MyColor {...] UReturnExpression [return (18, 2, 3)] = Nothing UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) [(18, 2, 3)] = external (18, 2, 3)(18, 2, 3) UIdentifier (Identifier (MyColor)) [UIdentifier (Identifier (MyColor))] - USimpleNameReferenceExpression (identifier = , resolvesTo = MyColor) [] = external (18, 2, 3)(18, 2, 3) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) [] = external (18, 2, 3)(18, 2, 3) ULiteralExpression (value = 18) [18] = 18 ULiteralExpression (value = 2) [2] = 2 ULiteralExpression (value = 3) [3] = 3 @@ -49,7 +49,7 @@ UFile (package = ) [public final class MyColor {...] UReturnExpression [return (1, 2, 3)] = Nothing UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) [(1, 2, 3)] = external (1, 2, 3)(1, 2, 3) UIdentifier (Identifier (MyColor)) [UIdentifier (Identifier (MyColor))] - USimpleNameReferenceExpression (identifier = , resolvesTo = MyColor) [] = external (1, 2, 3)(1, 2, 3) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) [] = external (1, 2, 3)(1, 2, 3) ULiteralExpression (value = 1) [1] = 1 ULiteralExpression (value = 2) [2] = 2 ULiteralExpression (value = 3) [3] = 3 @@ -57,7 +57,7 @@ UFile (package = ) [public final class MyColor {...] UAnnotation (fqName = org.jetbrains.annotations.NotNull) [@org.jetbrains.annotations.NotNull] UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 3)) [(1, 2, 3)] = external (1, 2, 3)(1, 2, 3) UIdentifier (Identifier (MyColor)) [UIdentifier (Identifier (MyColor))] - USimpleNameReferenceExpression (identifier = , resolvesTo = MyColor) [] = external (1, 2, 3)(1, 2, 3) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: MyColor) [] = external (1, 2, 3)(1, 2, 3) ULiteralExpression (value = 1) [1] = 1 ULiteralExpression (value = 2) [2] = 2 ULiteralExpression (value = 3) [3] = 3 diff --git a/plugins/uast-kotlin/testData/LocalDeclarations.log-ide.txt b/plugins/uast-kotlin/testData/LocalDeclarations.log-ide.txt index 090b85d49d6..872c844b6d7 100644 --- a/plugins/uast-kotlin/testData/LocalDeclarations.log-ide.txt +++ b/plugins/uast-kotlin/testData/LocalDeclarations.log-ide.txt @@ -12,14 +12,14 @@ UFile (package = ) UReturnExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Local)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) UDeclarationsExpression ULocalVariable (name = baz) ULambdaExpression UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Local)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) UDeclarationsExpression UVariable (name = someLocalFun) ULambdaExpression @@ -35,4 +35,4 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Local)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) \ No newline at end of file + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) diff --git a/plugins/uast-kotlin/testData/LocalDeclarations.log.txt b/plugins/uast-kotlin/testData/LocalDeclarations.log.txt index 04a28d2ea30..989f2dba02c 100644 --- a/plugins/uast-kotlin/testData/LocalDeclarations.log.txt +++ b/plugins/uast-kotlin/testData/LocalDeclarations.log.txt @@ -12,14 +12,14 @@ UFile (package = ) UReturnExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Local)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) UDeclarationsExpression ULocalVariable (name = baz) ULambdaExpression UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Local)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) UDeclarationsExpression UVariable (name = someLocalFun) ULambdaExpression @@ -35,4 +35,4 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Local)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) diff --git a/plugins/uast-kotlin/testData/LocalDeclarations.types.txt b/plugins/uast-kotlin/testData/LocalDeclarations.types.txt index 878f06ea5f5..da0925862ae 100644 --- a/plugins/uast-kotlin/testData/LocalDeclarations.types.txt +++ b/plugins/uast-kotlin/testData/LocalDeclarations.types.txt @@ -12,14 +12,14 @@ UFile (package = ) [public final class LocalDeclarationsKt {...] UReturnExpression [return ()] UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType: UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) [] : PsiType: + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] : PsiType: UDeclarationsExpression [var baz: kotlin.jvm.functions.Function0 = fun () {...}] ULocalVariable (name = baz) [var baz: kotlin.jvm.functions.Function0 = fun () {...}] ULambdaExpression [fun () {...}] UBlockExpression [{...}] : PsiType: UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType: UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) [] : PsiType: + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] : PsiType: UDeclarationsExpression [var someLocalFun: kotlin.jvm.functions.Function2 = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] UVariable (name = someLocalFun) [var someLocalFun: kotlin.jvm.functions.Function2 = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] ULambdaExpression [fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] @@ -35,4 +35,4 @@ UFile (package = ) [public final class LocalDeclarationsKt {...] USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] : PsiType: UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType: UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) [] : PsiType: + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] : PsiType: diff --git a/plugins/uast-kotlin/testData/LocalDeclarations.values.txt b/plugins/uast-kotlin/testData/LocalDeclarations.values.txt index 791501900cd..10c4499fdce 100644 --- a/plugins/uast-kotlin/testData/LocalDeclarations.values.txt +++ b/plugins/uast-kotlin/testData/LocalDeclarations.values.txt @@ -12,14 +12,14 @@ UFile (package = ) [public final class LocalDeclarationsKt {...] UReturnExpression [return ()] = Undetermined UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) [] = external ()() + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] = external ()() UDeclarationsExpression [var baz: kotlin.jvm.functions.Function0 = fun () {...}] = Undetermined ULocalVariable (name = baz) [var baz: kotlin.jvm.functions.Function0 = fun () {...}] ULambdaExpression [fun () {...}] = Undetermined UBlockExpression [{...}] = external ()() UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) [] = external ()() + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] = external ()() UDeclarationsExpression [var someLocalFun: kotlin.jvm.functions.Function2 = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] = Undetermined UVariable (name = someLocalFun) [var someLocalFun: kotlin.jvm.functions.Function2 = fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] ULambdaExpression [fun (@org.jetbrains.annotations.NotNull var text: java.lang.String) {...}] = Undetermined @@ -35,4 +35,4 @@ UFile (package = ) [public final class LocalDeclarationsKt {...] USimpleNameReferenceExpression (identifier = bar, resolvesTo = null) [bar] = external bar()() UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] = external ()() UIdentifier (Identifier (Local)) [UIdentifier (Identifier (Local))] - USimpleNameReferenceExpression (identifier = , resolvesTo = Local) [] = external ()() + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local) [] = external ()() diff --git a/plugins/uast-kotlin/testData/NonTrivialIdentifiers.log.txt b/plugins/uast-kotlin/testData/NonTrivialIdentifiers.log.txt index 4291e10bc4a..97180a87045 100644 --- a/plugins/uast-kotlin/testData/NonTrivialIdentifiers.log.txt +++ b/plugins/uast-kotlin/testData/NonTrivialIdentifiers.log.txt @@ -11,7 +11,7 @@ UFile (package = ) ULocalVariable (name = p) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (A)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) UIdentifier (Identifier ({)) USimpleNameReferenceExpression (identifier = invoke, resolvesTo = null) diff --git a/plugins/uast-kotlin/testData/ParametersDisorder.log-ide.txt b/plugins/uast-kotlin/testData/ParametersDisorder.log-ide.txt index 41b9a91c725..6e1661d9791 100644 --- a/plugins/uast-kotlin/testData/ParametersDisorder.log-ide.txt +++ b/plugins/uast-kotlin/testData/ParametersDisorder.log-ide.txt @@ -128,7 +128,7 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = with, resolvesTo = null) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (A)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) ULambdaExpression UBlockExpression UQualifiedReferenceExpression diff --git a/plugins/uast-kotlin/testData/ParametersDisorder.log.txt b/plugins/uast-kotlin/testData/ParametersDisorder.log.txt index e8a37796eef..274e9db8d9f 100644 --- a/plugins/uast-kotlin/testData/ParametersDisorder.log.txt +++ b/plugins/uast-kotlin/testData/ParametersDisorder.log.txt @@ -128,7 +128,7 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = with, resolvesTo = null) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (A)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) ULambdaExpression UBlockExpression UQualifiedReferenceExpression diff --git a/plugins/uast-kotlin/testData/QualifiedConstructorCall.log.txt b/plugins/uast-kotlin/testData/QualifiedConstructorCall.log.txt index ba9ce20661e..95db97b25a2 100644 --- a/plugins/uast-kotlin/testData/QualifiedConstructorCall.log.txt +++ b/plugins/uast-kotlin/testData/QualifiedConstructorCall.log.txt @@ -13,5 +13,5 @@ UFile (package = A.B.C) USimpleNameReferenceExpression (identifier = C) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Foo)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Foo) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Foo) UMethod (name = Bar) diff --git a/plugins/uast-kotlin/testData/SimpleScript.log.txt b/plugins/uast-kotlin/testData/SimpleScript.log.txt index af6b6f03ba0..31ca1199adc 100644 --- a/plugins/uast-kotlin/testData/SimpleScript.log.txt +++ b/plugins/uast-kotlin/testData/SimpleScript.log.txt @@ -9,7 +9,7 @@ UFile (package = ) USimpleNameReferenceExpression (identifier = flag) UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (Bar)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Bar) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Bar) ULiteralExpression (value = 42) ULiteralExpression (value = null) UMethod (name = main) diff --git a/plugins/uast-kotlin/testData/SuperCalls.log-ide.txt b/plugins/uast-kotlin/testData/SuperCalls.log-ide.txt index e55664a2f9a..b85474c2da2 100644 --- a/plugins/uast-kotlin/testData/SuperCalls.log-ide.txt +++ b/plugins/uast-kotlin/testData/SuperCalls.log-ide.txt @@ -20,7 +20,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (A)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) ULiteralExpression (value = "inner class") UMethod (name = getAnon) UMethod (name = cons) @@ -44,7 +44,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (this)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) UQualifiedReferenceExpression USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) @@ -57,7 +57,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (A)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) USimpleNameReferenceExpression (identifier = param) UClass (name = C) UMethod (name = foo) @@ -76,7 +76,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (super)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) USimpleNameReferenceExpression (identifier = p) UMethod (name = C) UParameter (name = i) @@ -84,7 +84,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (super)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (println)) @@ -96,5 +96,5 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (A)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) ULiteralExpression (value = "text") diff --git a/plugins/uast-kotlin/testData/SuperCalls.log.txt b/plugins/uast-kotlin/testData/SuperCalls.log.txt index 5cdd4558f78..24ae64283c8 100644 --- a/plugins/uast-kotlin/testData/SuperCalls.log.txt +++ b/plugins/uast-kotlin/testData/SuperCalls.log.txt @@ -20,7 +20,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (A)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) ULiteralExpression (value = "inner class") UMethod (name = getAnon) UMethod (name = cons) @@ -44,7 +44,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (this)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) UQualifiedReferenceExpression USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) @@ -57,7 +57,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (A)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) USimpleNameReferenceExpression (identifier = param) UClass (name = C) UMethod (name = foo) @@ -76,7 +76,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (super)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) USimpleNameReferenceExpression (identifier = p) UMethod (name = C) UParameter (name = i) @@ -84,7 +84,7 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (super)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) USimpleNameReferenceExpression (identifier = i) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (println)) @@ -96,5 +96,5 @@ UFile (package = ) UBlockExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (A)) - USimpleNameReferenceExpression (identifier = , resolvesTo = A) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: A) ULiteralExpression (value = "text") diff --git a/plugins/uast-kotlin/testData/Suspend.log-ide.txt b/plugins/uast-kotlin/testData/Suspend.log-ide.txt index 7efb0bebd40..d291425dddf 100644 --- a/plugins/uast-kotlin/testData/Suspend.log-ide.txt +++ b/plugins/uast-kotlin/testData/Suspend.log-ide.txt @@ -8,7 +8,7 @@ UFile (package = test.pkg) UQualifiedReferenceExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Context)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Context) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Context) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (inner)) USimpleNameReferenceExpression (identifier = inner, resolvesTo = null) @@ -27,4 +27,4 @@ UFile (package = test.pkg) UReturnExpression UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (inner)) - USimpleNameReferenceExpression (identifier = inner, resolvesTo = null) \ No newline at end of file + USimpleNameReferenceExpression (identifier = inner, resolvesTo = null) diff --git a/plugins/uast-kotlin/testData/Suspend.log.txt b/plugins/uast-kotlin/testData/Suspend.log.txt index 550624300f8..dca56074c1b 100644 --- a/plugins/uast-kotlin/testData/Suspend.log.txt +++ b/plugins/uast-kotlin/testData/Suspend.log.txt @@ -8,7 +8,7 @@ UFile (package = test.pkg) UQualifiedReferenceExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (Context)) - USimpleNameReferenceExpression (identifier = , resolvesTo = Context) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Context) UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) UIdentifier (Identifier (inner)) USimpleNameReferenceExpression (identifier = inner, resolvesTo = null) diff --git a/plugins/uast-kotlin/testData/UnexpectedContainerException.log-ide.txt b/plugins/uast-kotlin/testData/UnexpectedContainerException.log-ide.txt index 29df09cd201..6e2ea159de7 100644 --- a/plugins/uast-kotlin/testData/UnexpectedContainerException.log-ide.txt +++ b/plugins/uast-kotlin/testData/UnexpectedContainerException.log-ide.txt @@ -13,7 +13,7 @@ UFile (package = ) UThrowExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (UnsupportedOperationException)) - USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) UMethod (name = Model) UBlockExpression UBlockExpression @@ -35,6 +35,6 @@ UFile (package = ) UThrowExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (UnsupportedOperationException)) - USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) ULiteralExpression (value = "") UMethod (name = ) diff --git a/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt b/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt index d8b0fa29d03..9f26da67cc3 100644 --- a/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt +++ b/plugins/uast-kotlin/testData/UnexpectedContainerException.log.txt @@ -13,7 +13,7 @@ UFile (package = ) UThrowExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) UIdentifier (Identifier (UnsupportedOperationException)) - USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) UMethod (name = Model) UBlockExpression UBlockExpression @@ -35,6 +35,6 @@ UFile (package = ) UThrowExpression UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) UIdentifier (Identifier (UnsupportedOperationException)) - USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) 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 9b22766399f..bb35552aaff 100644 --- a/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt +++ b/plugins/uast-kotlin/testData/UnexpectedContainerException.types.txt @@ -13,7 +13,7 @@ UFile (package = ) [public abstract interface Callback {...] UThrowExpression [throw ()] : PsiType:Void UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [()] : PsiType:UnsupportedOperationException UIdentifier (Identifier (UnsupportedOperationException)) [UIdentifier (Identifier (UnsupportedOperationException))] - USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) [] : PsiType:UnsupportedOperationException + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) [] : PsiType:UnsupportedOperationException UMethod (name = Model) [public fun Model() {...}] UBlockExpression [{...}] UBlockExpression [{...}] : PsiType:void @@ -35,6 +35,6 @@ UFile (package = ) [public abstract interface Callback {...] UThrowExpression [throw ("")] : PsiType:Void UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 1)) [("")] : PsiType:UnsupportedOperationException UIdentifier (Identifier (UnsupportedOperationException)) [UIdentifier (Identifier (UnsupportedOperationException))] - USimpleNameReferenceExpression (identifier = , resolvesTo = UnsupportedOperationException) [] : PsiType:UnsupportedOperationException + USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: UnsupportedOperationException) [] : PsiType:UnsupportedOperationException ULiteralExpression (value = "") [""] : PsiType:String UMethod (name = Model$1$1) [fun Model$1$1() = UastEmptyExpression] diff --git a/plugins/uast-kotlin/tests/KotlinUastApiTest.kt b/plugins/uast-kotlin/tests/KotlinUastApiTest.kt index f1f58a80296..36dcfcf7145 100644 --- a/plugins/uast-kotlin/tests/KotlinUastApiTest.kt +++ b/plugins/uast-kotlin/tests/KotlinUastApiTest.kt @@ -597,7 +597,7 @@ class KotlinUastApiTest : AbstractKotlinUastTest() { val localFunctionResolved = localFunction.resolve() assertNotNull(localFunctionResolved) val classReference = localFunction.classReference ?: kfail("classReference expected") - assertEquals("USimpleNameReferenceExpression (identifier = , resolvesTo = Local)", classReference.asLogString()) + assertEquals("USimpleNameReferenceExpression (identifier = , resolvesTo = PsiClass: Local)", classReference.asLogString()) val localClass = classReference.resolve().toUElement() ?: kfail("uelement expected") assertEquals("UClass (name = Local)", localClass.asLogString()) assertEquals(localClass, localFunctionResolved.toUElement())