< prev index next >

langtools/test/tools/javac/lambda/8074381/T8074381a.java

Print this page


   1 /*
   2  * @test /nodynamiccopyright/
   3  * @bug 8074381
   4  * @summary java.lang.AssertionError during compiling
   5  * @compile/fail/ref=T8074381a.out -XDrawDiagnostics T8074381a.java
   6  */
   7 class T8074381a {
   8     interface Sup<X> {
   9         boolean m(X x);
  10     }
  11 
  12     interface Sub<X> extends Sup<String> {
  13         boolean m(String s);
  14     }
  15 

  16     void testRaw() {
  17         Sub s1 = c -> true;
  18         Sub s2 = Boolean::new;
  19         Sub s3 = new Sub() {
  20             @Override
  21             public boolean m(String o) { return true; }
  22         };
  23     }
  24 

  25     void testNonRaw() {
  26         Sub<Integer> s1 = c -> true;
  27         Sub<Integer> s2 = Boolean::new;
  28         Sub<Integer> s3 = new Sub<Integer>() {
  29             @Override
  30             public boolean m(String o) { return true; }
  31         };
  32     }
  33 }
   1 /*
   2  * @test /nodynamiccopyright/
   3  * @bug 8074381
   4  * @summary java.lang.AssertionError during compiling
   5  * @compile/fail/ref=T8074381a.out -XDrawDiagnostics T8074381a.java
   6  */
   7 class T8074381a {
   8     interface Sup<X> {
   9         boolean m(X x);
  10     }
  11 
  12     interface Sub<X> extends Sup<String> {
  13         boolean m(String s);
  14     }
  15 
  16     @SuppressWarnings("deprecation")
  17     void testRaw() {
  18         Sub s1 = c -> true;
  19         Sub s2 = Boolean::new;
  20         Sub s3 = new Sub() {
  21             @Override
  22             public boolean m(String o) { return true; }
  23         };
  24     }
  25 
  26     @SuppressWarnings("deprecation")
  27     void testNonRaw() {
  28         Sub<Integer> s1 = c -> true;
  29         Sub<Integer> s2 = Boolean::new;
  30         Sub<Integer> s3 = new Sub<Integer>() {
  31             @Override
  32             public boolean m(String o) { return true; }
  33         };
  34     }
  35 }
< prev index next >