mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-03 15:50:52 +07:00
lambda: initial is assignable check; effectively final; acceptable context
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
interface I {
|
||||
int m(int i);
|
||||
}
|
||||
|
||||
public class XXX {
|
||||
|
||||
static void foo() {
|
||||
int l = 0;
|
||||
int j = 0;
|
||||
j = 2;
|
||||
final int L = 0;
|
||||
I i = (int h) -> { int k = 0; return h + <error descr="Variable used in lambda expression should be effectively final">j</error> + l + L; };
|
||||
}
|
||||
|
||||
void bar() {
|
||||
int l = 0;
|
||||
int j = 0;
|
||||
j = 2;
|
||||
final int L = 0;
|
||||
I i = (int h) -> { int k = 0; return h + k + <error descr="Variable used in lambda expression should be effectively final">j</error> + l + L; };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user