1 /*
   2  * @test /nodynamiccopyright/
   3  * @summary smoke test for sealed classes
   4  * @compile/fail/ref=AnonymousAndLambdaCantExtendSealed.out -XDrawDiagnostics AnonymousAndLambdaCantExtendSealed.java
   5  */
   6 
   7 class AnonymousAndLambdaCantExtendSealed {
   8     sealed interface I1 extends Runnable {
   9         public static I1 i = () -> {};
  10     }
  11 
  12     sealed interface I2 extends Runnable {
  13         public static void foo() { new I2() { public void run() { } }; }
  14     }
  15 }