mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Uast: cleanup after KT-25297 fixed
GitOrigin-RevId: b561fd5dbdcd2c62163fe66f37e51fd75298fc25
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cf0bd60d70
commit
6455d10a82
@@ -133,15 +133,6 @@ public final class AnalysisUastUtil {
|
||||
if (functionalInterfaceType != null) {
|
||||
return LambdaUtil.getFunctionalInterfaceReturnType(functionalInterfaceType);
|
||||
}
|
||||
|
||||
// if `functionalInterfaceType` will return proper type for Kotlin (after KT-25297 is fixed) then this part could be dropped
|
||||
UElement lambdaParent = parent.getUastParent();
|
||||
if (lambdaParent instanceof UCallExpression) {
|
||||
PsiParameter lambdaParameter = UastUtils.getParameterForArgument(((UCallExpression)lambdaParent), ((ULambdaExpression)parent));
|
||||
if (lambdaParameter == null) return null;
|
||||
return LambdaUtil.getFunctionalInterfaceReturnType(lambdaParameter.getType());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
if (parent instanceof UClass) {
|
||||
|
||||
@@ -215,7 +215,6 @@ fun UCallExpression.getParameterForArgument(arg: UExpression): PsiParameter? {
|
||||
return parameters.withIndex().find { (i, p) ->
|
||||
val argumentForParameter = getArgumentForParameter(i) ?: return@find false
|
||||
if (wrapULiteral(argumentForParameter) == wrapULiteral(arg)) return@find true
|
||||
if (arg is ULambdaExpression && arg.sourcePsi?.parent == argumentForParameter.sourcePsi) return@find true // workaround for KT-25297
|
||||
if (p.isVarArgs && argumentForParameter is UExpressionList) return@find argumentForParameter.expressions.contains(arg)
|
||||
return@find false
|
||||
}?.value
|
||||
|
||||
Reference in New Issue
Block a user