mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-96404 java type inference does not work in for-each template
This commit is contained in:
@@ -417,7 +417,7 @@ class ControlFlowAnalyzer extends JavaElementVisitor {
|
||||
generateBoxingUnboxingInstructionFor(condition, PsiType.BOOLEAN);
|
||||
}
|
||||
else {
|
||||
addInstruction(new PushInstruction(myFactory.getConstFactory().getTrue(), null));
|
||||
addInstruction(new PushInstruction(null, null));
|
||||
}
|
||||
addInstruction(new ConditionalGotoInstruction(getEndOffset(statement), true, condition));
|
||||
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
public abstract class Zzza {
|
||||
|
||||
void foo(Object o) {
|
||||
if (o instanceof String) {
|
||||
for (java.lang.Object : o.substr<caret>) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
public abstract class Zzza {
|
||||
|
||||
void foo(Object o) {
|
||||
if (o instanceof String) {
|
||||
for (java.lang.Object : ((String) o).substring(<caret>)) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
@@ -890,6 +890,7 @@ public class ListUtils {
|
||||
}
|
||||
|
||||
public void testCastInstanceofedQualifier() throws Throwable { doTest(); }
|
||||
public void testCastInstanceofedQualifierInForeach() throws Throwable { doTest(); }
|
||||
public void testCastComplexInstanceofedQualifier() throws Throwable { doTest(); }
|
||||
|
||||
public void testCastTooComplexInstanceofedQualifier() throws Throwable { doAntiTest(); }
|
||||
|
||||
Reference in New Issue
Block a user