IDEA-96404 java type inference does not work in for-each template

This commit is contained in:
peter
2012-12-19 19:36:33 +01:00
parent e4cf80e56c
commit 4341bc7222
4 changed files with 26 additions and 1 deletions
@@ -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));
@@ -0,0 +1,12 @@
public abstract class Zzza {
void foo(Object o) {
if (o instanceof String) {
for (java.lang.Object : o.substr<caret>) {
}
}
}
}
@@ -0,0 +1,12 @@
public abstract class Zzza {
void foo(Object o) {
if (o instanceof String) {
for (java.lang.Object : ((String) o).substring(<caret>)) {
}
}
}
}
@@ -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(); }