mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-10 18:09:38 +07:00
Avoid suggesting counting loop if loop variable must be effectively final
GitOrigin-RevId: eb15165f5034fa75de9c9af97fb2707a233e9fe5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1df2a19a7a
commit
f988f89bbd
@@ -0,0 +1,14 @@
|
||||
// "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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// "Collapse into loop" "true"
|
||||
class X {
|
||||
void test() {
|
||||
<caret>consume(() -> 1);
|
||||
consume(() -> 2);
|
||||
consume(() -> 3);
|
||||
consume(() -> 4);
|
||||
}
|
||||
|
||||
void consume(IntSupplier x) {}
|
||||
|
||||
interface IntSupplier {
|
||||
int supply();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user