jdk-24/test/langtools/tools/javac/lambda/EffectivelyFinal01.java
2017-09-12 19:03:39 +02:00

19 lines
465 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8003280
* @summary Add lambda tests
* effectively final check fails on method parameter
* @compile/fail/ref=EffectivelyFinal01.out -XDrawDiagnostics EffectivelyFinal01.java
*/
class EffectivelyFinal01 {
interface SAM {
Integer m(Integer i);
}
void test(Integer nefPar) {
SAM s = (Integer h) -> { Integer k = 0; return k + h + nefPar; };
nefPar++; //non-effectively final
}
}