mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
KT UAST: look up closest scopes (lambdas) first
...when building implicit receiver Otherwise, we will pick the containing class (for instance functions) first even though the call is inside a lambda. ^KTIJ-32595 GitOrigin-RevId: d3cfec15e48a2162e8ab8decd1915f25009eca8e
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2c367f5f0b
commit
6948aad85e
+7
-5
@@ -307,11 +307,7 @@ class KotlinUFunctionCallExpression(
|
||||
callableDeclaration.containingClass
|
||||
}
|
||||
?: return null
|
||||
val containingUClass = getContainingUClass()
|
||||
if (implicitReceiver is PsiClass && implicitReceiver == containingUClass?.javaPsi) {
|
||||
// Implicit `this`
|
||||
return KotlinUImplicitThis(implicitReceiver, receiverType, this)
|
||||
}
|
||||
|
||||
// Lambda receiver
|
||||
var enclosingLambda = this.getParentOfType<ULambdaExpression>()
|
||||
while (enclosingLambda != null) {
|
||||
@@ -334,6 +330,12 @@ class KotlinUFunctionCallExpression(
|
||||
enclosingLambda = enclosingLambda.getParentOfType<ULambdaExpression>()
|
||||
}
|
||||
|
||||
val containingUClass = getContainingUClass()
|
||||
if (implicitReceiver is PsiClass && implicitReceiver == containingUClass?.javaPsi) {
|
||||
// Implicit `this`
|
||||
return KotlinUImplicitThis(implicitReceiver, receiverType, this)
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user