mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method refs: disable suggestions to change/migrate type of variable if right type is method reference - no way to suggest correct type now (IDEA-92600)
This commit is contained in:
@@ -481,7 +481,7 @@ public class HighlightUtil {
|
||||
int start = variable.getTypeElement().getTextRange().getStartOffset();
|
||||
int end = variable.getTextRange().getEndOffset();
|
||||
HighlightInfo highlightInfo = checkAssignability(lType, rType, initializer, new TextRange(start, end));
|
||||
if (highlightInfo != null) {
|
||||
if (highlightInfo != null && !(rType instanceof PsiMethodReferenceType)) {
|
||||
registerChangeVariableTypeFixes(variable, rType, highlightInfo);
|
||||
}
|
||||
return highlightInfo;
|
||||
|
||||
+2
-1
@@ -271,7 +271,8 @@ public class UncheckedWarningLocalInspection extends BaseJavaLocalInspectionTool
|
||||
PsiExpression initializer = variable.getInitializer();
|
||||
if (initializer == null || initializer instanceof PsiArrayInitializerExpression) return;
|
||||
final PsiType initializerType = initializer.getType();
|
||||
checkRawToGenericsAssignment(initializer, variable.getType(), initializerType, true, myOnTheFly ? getChangeVariableTypeFixes(variable, initializerType) : LocalQuickFix.EMPTY_ARRAY);
|
||||
checkRawToGenericsAssignment(initializer, variable.getType(), initializerType, true,
|
||||
myOnTheFly && !(initializerType instanceof PsiMethodReferenceType) ? getChangeVariableTypeFixes(variable, initializerType) : LocalQuickFix.EMPTY_ARRAY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user