mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 05:21:29 +07:00
calc expected type on the left of assignment based on standalone expression type from the right side (IDEA-199273)
This commit is contained in:
@@ -567,7 +567,7 @@ public class ExpectedTypesProvider {
|
||||
|
||||
PsiExpression rExpr = assignment.getRExpression();
|
||||
if (rExpr != null) {
|
||||
PsiType type = rExpr.getType();
|
||||
PsiType type = MethodCandidateInfo.ourOverloadGuard.doPreventingRecursion(assignment, false, () -> rExpr.getType());
|
||||
if (type != null && type != PsiType.NULL) {
|
||||
if (type instanceof PsiClassType) {
|
||||
final PsiClass resolved = ((PsiClassType)type).resolve();
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create local variable 't'" "true"
|
||||
class Test {
|
||||
private void f(boolean f) {
|
||||
String t = f ? null : "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create local variable 't'" "true"
|
||||
class Test {
|
||||
private void f(boolean f) {
|
||||
<caret>t = f ? null : "";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user