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