Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/collapseIntoLoop/afterNoCountingWhenUsedInLambda.java
Tagir Valeev f988f89bbd Avoid suggesting counting loop if loop variable must be effectively final
GitOrigin-RevId: eb15165f5034fa75de9c9af97fb2707a233e9fe5
2020-06-17 07:41:39 +03:00

14 lines
229 B
Java

// "Collapse into loop" "true"
class X {
void test() {
for (int i : new int[]{1, 2, 3, 4}) {
consume(() -> i);
}
}
void consume(IntSupplier x) {}
interface IntSupplier {
int supply();
}
}