48d8650ae1
8254047: [JEP 390] Revise "value-based class" & apply to wrappers 8252181: [JEP 390] Define & apply annotation jdk.internal.ValueBased 8252183: [JEP 390] Add 'lint' warning for @ValueBased classes 8257027: [JEP 390] Diagnose synchronization on @ValueBased classes 8252180: [JEP 390] Deprecate wrapper class constructors for removal Co-authored-by: Roger Riggs <rriggs@openjdk.org> Co-authored-by: Srikanth Adayapalam <sadayapalam@openjdk.org> Co-authored-by: Lois Foltan <lfoltan@openjdk.org> Reviewed-by: rriggs, hseigel, mchung, darcy
36 lines
876 B
Java
36 lines
876 B
Java
/*
|
|
* @test /nodynamiccopyright/
|
|
* @bug 8074381
|
|
* @summary java.lang.AssertionError during compiling
|
|
* @compile/fail/ref=T8074381a.out -XDrawDiagnostics T8074381a.java
|
|
*/
|
|
class T8074381a {
|
|
interface Sup<X> {
|
|
boolean m(X x);
|
|
}
|
|
|
|
interface Sub<X> extends Sup<String> {
|
|
boolean m(String s);
|
|
}
|
|
|
|
@SuppressWarnings({"deprecation", "removal"})
|
|
void testRaw() {
|
|
Sub s1 = c -> true;
|
|
Sub s2 = Boolean::new;
|
|
Sub s3 = new Sub() {
|
|
@Override
|
|
public boolean m(String o) { return true; }
|
|
};
|
|
}
|
|
|
|
@SuppressWarnings({"deprecation", "removal"})
|
|
void testNonRaw() {
|
|
Sub<Integer> s1 = c -> true;
|
|
Sub<Integer> s2 = Boolean::new;
|
|
Sub<Integer> s3 = new Sub<Integer>() {
|
|
@Override
|
|
public boolean m(String o) { return true; }
|
|
};
|
|
}
|
|
}
|