mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
[java] support comparing when method is a first operand
GitOrigin-RevId: 64895b894c8dee5c178bfb336a4f2f30872a13c4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f77617b690
commit
4882e88dbf
@@ -921,6 +921,13 @@ public final class ExpectedTypesProvider {
|
||||
if (op == JavaTokenType.EQEQ || op == JavaTokenType.NE) {
|
||||
ContainerUtil.addIfNotNull(myResult, getEqualsType(anotherExpr));
|
||||
}
|
||||
if (op == JavaTokenType.LT || op == JavaTokenType.LE ||
|
||||
op == JavaTokenType.GT || op == JavaTokenType.GE) {
|
||||
PsiType anotherType = anotherExpr != null ? anotherExpr.getType() : null;
|
||||
if (anotherType != null) {
|
||||
myResult.add(createInfoImpl(PsiTypes.doubleType(), anotherType));
|
||||
}
|
||||
}
|
||||
final MyParentVisitor visitor = new MyParentVisitor(expr, true, myClassProvider, myVoidable, myUsedAfter, myMaxCandidates);
|
||||
myExpr = (PsiExpression)myExpr.getParent();
|
||||
expr.getParent().accept(visitor);
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public void testStart() {
|
||||
if (test() < 1) {
|
||||
}
|
||||
}
|
||||
|
||||
private int test() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Create method 'test'" "true-preview"
|
||||
public class Test {
|
||||
public void testStart() {
|
||||
if (te<caret>st() < 1) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user