foreach loop variable shouldn't be visible from the loop expression (IDEA-55859)

This commit is contained in:
peter
2011-03-03 20:07:54 +01:00
parent 588f929005
commit f145812a77
5 changed files with 12 additions and 11 deletions
@@ -0,0 +1,5 @@
public class Bar {{
for (java.util.List trololo : trolo<caret>) {
}
} }
@@ -181,7 +181,7 @@ public class a {
}
void forEachParam(java.io.File x) {
for (java.io.File f: <error descr="Variable 'f' might not have been initialized">f</error>.listFiles()) {
for (java.io.File f: <error descr="Cannot resolve symbol 'f'">f</error>.listFiles()) {
forEachParam(f);
}
}
@@ -910,6 +910,8 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
public void testEmptyListWithCollectionsPrefix() throws Throwable { doItemTest(); }
public void testForeachLoopVariableInIterableExpression() throws Throwable { doAntiTest(); }
public void testStaticallyImportedMagicMethod() throws Throwable {
configureByTestName();
assertStringItems("foo");