reject caching during resolve only inside lambda body (IDEA-138511)
[idea/community.git] / java / java-psi-api / src / com / intellij / psi / LambdaUtil.java
index 954dd08703c9867f2ec0c688f1a36a5fb889779c..9d4cf552c4fe40c94d19abe402ff65ee4a752b52 100644 (file)
@@ -340,6 +340,9 @@ public class LambdaUtil {
         if (gParent instanceof PsiCall) {
           final PsiCall contextCall = (PsiCall)gParent;
           final MethodCandidateInfo.CurrentCandidateProperties properties = MethodCandidateInfo.getCurrentMethod(contextCall.getArgumentList());
+          if (MethodCandidateInfo.isOverloadCheck()) {
+            MethodCandidateInfo.ourOverloadGuard.prohibitResultCaching(MethodCandidateInfo.ourOverloadGuard.currentStack().get(0));
+          }
           if (properties != null && properties.isApplicabilityCheck()) { //todo simplification
             final PsiParameter[] parameters = properties.getMethod().getParameterList().getParameters();
             final int finalLambdaIdx = adjustLambdaIdx(lambdaIdx, properties.getMethod(), parameters);