1 /*
 2  * @test /nodynamiccopyright/
 3  * @modules jdk.incubator.code
 4  * @compile/fail/ref=TestNoCodeReflectionInInnerClasses.out -Werror -Xlint:-incubating -XDrawDiagnostics TestNoCodeReflectionInInnerClasses.java
 5  */
 6 
 7 import jdk.incubator.code.*;
 8 
 9 class TestNoCodeReflectionInInnerClasses {
10     class Inner {
11         @Reflect
12         public void test1() { }
13 
14         void test2() {
15             Runnable q = (@Reflect Runnable) () -> { };
16         }
17 
18         void test3() {
19             Runnable q = (@Reflect Runnable) this::test2;
20         }
21     }
22 }