1 /*
2  * @test /nodynamiccopyright/
3  * @bug 8015648
4  * @summary Duplicate variable in lambda causes javac crash
5  * @compile/fail/ref=LambdaScope05.out -XDrawDiagnostics LambdaScope05.java
6  */
7 
8 class LambdaScope05 {
9     interface VoidFun1 {
m(int i)10         void m(int i);
11     }
12 
13     static Runnable r1 = () -> { VoidFun1 p = p -> { }; };
14     Runnable r2 = () -> { VoidFun1 p = p -> { }; };
15 
16     static {
17         Runnable r = () -> { VoidFun1 p = p -> { }; };
18     }
19 
20     {
21         Runnable r = () -> { VoidFun1 p = p -> { }; };
22     }
23 
m_static()24     static void m_static() {
25         Runnable r = () -> { VoidFun1 p = p -> { }; };
26     }
27 
m()28     void m() {
29         Runnable r = () -> { VoidFun1 p = p -> { }; };
30     }
31 }
32