mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
Do not suggest List<Void> type
Reported in IDEA-238075 GitOrigin-RevId: 3dc190cde20482c015321ba02a54adb0c238af46
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4a4734d1ee
commit
78309def42
@@ -103,6 +103,9 @@ public class VariableTypeFromCallFix implements IntentionAction {
|
||||
parameters,
|
||||
expressions, PsiSubstitutor.EMPTY, resolved,
|
||||
DefaultParameterTypeInferencePolicy.INSTANCE);
|
||||
if (psiSubstitutor.getSubstitutionMap().values().stream().anyMatch(t -> t.equalsToText(CommonClassNames.JAVA_LANG_VOID))) {
|
||||
continue;
|
||||
}
|
||||
final PsiType appropriateVarType = GenericsUtil.getVariableTypeByExpressionType(JavaPsiFacade.getElementFactory(
|
||||
project).createType(varClass, psiSubstitutor));
|
||||
if (!varType.equals(appropriateVarType)) {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Change variable 'l' type to 'List<Void>'" "false"
|
||||
import java.util.List;
|
||||
|
||||
public class Test {
|
||||
void foo() {
|
||||
List<String> l = null;
|
||||
l.add(b<caret>ar());
|
||||
}
|
||||
void bar() {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user