mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
incompatible types quickfix: reregister for variable initializer (IDEA-138023)
This commit is contained in:
+1
-5
@@ -479,6 +479,7 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
HighlightInfo highlightInfo = checkAssignability(lType, rType, initializer, new TextRange(start, end), 0);
|
||||
if (highlightInfo != null) {
|
||||
registerChangeVariableTypeFixes(variable, rType, variable.getInitializer(), highlightInfo);
|
||||
registerChangeVariableTypeFixes(initializer, lType, null, highlightInfo);
|
||||
}
|
||||
return highlightInfo;
|
||||
}
|
||||
@@ -2731,11 +2732,6 @@ public class HighlightUtil extends HighlightUtilBase {
|
||||
QuickFixAction.registerQuickFixAction(highlightInfo, PriorityActionWrapper
|
||||
.lowPriority(method, QUICK_FIX_FACTORY.createMethodReturnFix(method, parameter.getType(), true)));
|
||||
}
|
||||
} else if (expr instanceof PsiReferenceExpression) {
|
||||
final PsiElement resolve = ((PsiReferenceExpression)expr).resolve();
|
||||
if (resolve instanceof PsiVariable) {
|
||||
registerChangeVariableTypeFixes((PsiVariable)resolve, parameter.getType(), null, highlightInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Change field 'foo' type to 'java.lang.String[]'" "true"
|
||||
|
||||
class Base {
|
||||
private String[] foo;
|
||||
public void bar(String... args) {
|
||||
foo = args;
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Change field 'foo' type to 'java.lang.String[]'" "true"
|
||||
|
||||
class Base {
|
||||
private String foo;
|
||||
public void bar(String... args) {
|
||||
foo<caret> = args;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user