mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 01:24:33 +02:00
8053906: javac is accepting a self-referencing variable initializer inside a lambda expression
Reviewed-by: jlahoda
This commit is contained in:
parent
966fc670ee
commit
8a2078e8a3
11 changed files with 102 additions and 122 deletions
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* @test /nodynamiccopyright/
|
||||
* @bug 8024809
|
||||
* @summary javac, some lambda programs are rejected by flow analysis
|
||||
* @compile/fail/ref=SelfInitializerInLambdaTestb.out -XDrawDiagnostics SelfInitializerInLambdaTestb.java
|
||||
*/
|
||||
|
||||
public class SelfInitializerInLambdaTestb {
|
||||
|
||||
final Runnable r1;
|
||||
|
||||
final Runnable r2 = ()-> System.out.println(r1);
|
||||
|
||||
SelfInitializerInLambdaTestb() {
|
||||
r1 = ()->System.out.println(r1);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue