mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
[java-highlighting] IDEA-378301 False compilation error on var initialization
GitOrigin-RevId: 09b681b763347bcfcadca137d3e0c57cbe39f33a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
221d2ae497
commit
b9e6544c21
+3
@@ -84,6 +84,9 @@ final class TypeChecker {
|
||||
PsiExpression initializer = variable.getInitializer();
|
||||
// array initializer checked in checkArrayInitializerApplicable
|
||||
if (initializer == null || initializer instanceof PsiArrayInitializerExpression) return;
|
||||
PsiTypeElement typeElement = variable.getTypeElement();
|
||||
// initializer cannot be incompatible with the inferred type
|
||||
if (typeElement != null && typeElement.isInferredType()) return;
|
||||
PsiType lType = variable.getType();
|
||||
PsiType rType = initializer.getType();
|
||||
myVisitor.myExpressionChecker.checkAssignability(lType, rType, initializer, initializer);
|
||||
|
||||
Reference in New Issue
Block a user