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

27 lines
714 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8053906
* @summary javac, some lambda programs are rejected by flow analysis
* @compile/fail/ref=SelfInitializerInLambdaTestc.out -XDrawDiagnostics SelfInitializerInLambdaTestc.java
*/
public class SelfInitializerInLambdaTestc {
interface SAM {
void foo();
}
final SAM notInitialized = ()-> {
SAM simpleVariable = () -> notInitialized.foo();
};
final SAM notInitialized2 = ()-> {
SAM simpleVariable1 = () -> {
SAM simpleVariable2 = () -> {
SAM simpleVariable3 = () -> {
SAM simpleVariable4 = () -> notInitialized2.foo();
};
};
};
};
}