mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
[java-psi] LambdaUtil.getFunctionalInterfaceType: force returning null type for variables with inferred type
Otherwise, we may have a chicken-egg problem, when the inferred type is computed using its initializer and the initializer type is computed using the variable type which is not computed yet Fixes IDEA-371650 [Java] test problem com.intellij.java.codeInsight.daemon.LightAdvLVTIHighlightingTest.testSimpleAvailability: Non-idempotent computation (cherry picked from commit 69f4608ea9ba6ce98cda8c02acdc51134d4c5552) IJ-CR-163729 GitOrigin-RevId: 6dbe3502b3d730b04766567feaff8442988971f9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b99f825790
commit
c890dda4f6
@@ -390,7 +390,9 @@ public final class LambdaUtil {
|
||||
return castType;
|
||||
}
|
||||
else if (parent instanceof PsiVariable) {
|
||||
return ((PsiVariable)parent).getType();
|
||||
PsiVariable variable = (PsiVariable)parent;
|
||||
PsiTypeElement typeElement = variable.getTypeElement();
|
||||
return typeElement != null && typeElement.isInferredType() ? null : variable.getType();
|
||||
}
|
||||
else if (parent instanceof PsiAssignmentExpression && expression instanceof PsiExpression && !PsiUtil.isOnAssignmentLeftHand((PsiExpression)expression)) {
|
||||
final PsiExpression lExpression = ((PsiAssignmentExpression)parent).getLExpression();
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.intellij.codeInspection.AnonymousCanBeLambdaInspection;
|
||||
import com.intellij.codeInspection.redundantCast.RedundantCastInspection;
|
||||
import com.intellij.openapi.projectRoots.JavaSdkVersion;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.util.RecursionManager;
|
||||
import com.intellij.pom.java.LanguageLevel;
|
||||
import com.intellij.psi.CommonClassNames;
|
||||
import com.intellij.psi.PsiClass;
|
||||
@@ -43,7 +42,6 @@ public class LightAdvLVTIHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
}
|
||||
|
||||
public void testSimpleAvailability() {
|
||||
RecursionManager.disableMissedCacheAssertions(getTestRootDisposable());
|
||||
doTest();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user