2012-10-04 13:04:53 +01:00
|
|
|
/*
|
2020-12-30 17:20:54 +00:00
|
|
|
* @test /nodynamiccopyright/
|
2015-04-22 09:44:15 -07:00
|
|
|
* @bug 8004102 8078024
|
2012-11-30 15:14:25 +00:00
|
|
|
* @summary Add support for generic functional descriptors
|
|
|
|
* @compile/fail/ref=MethodReference58.out -XDrawDiagnostics MethodReference58.java
|
|
|
|
*/
|
|
|
|
class MethodReference58 {
|
2012-10-04 13:04:53 +01:00
|
|
|
|
2012-11-30 15:14:25 +00:00
|
|
|
interface F_Object {
|
|
|
|
<X> void m(X x);
|
|
|
|
}
|
|
|
|
|
|
|
|
interface F_Integer {
|
|
|
|
<X extends Integer> void m(X x);
|
|
|
|
}
|
2012-10-04 13:04:53 +01:00
|
|
|
|
2012-11-30 15:14:25 +00:00
|
|
|
void test() {
|
|
|
|
F_Object f1 = this::g; //incompatible bounds
|
|
|
|
F_Integer f2 = this::g; //ok
|
2012-10-04 13:04:53 +01:00
|
|
|
}
|
2012-10-05 14:35:24 +01:00
|
|
|
|
2012-11-30 15:14:25 +00:00
|
|
|
<Z extends Number> void g(Z z) { }
|
2012-10-04 13:04:53 +01:00
|
|
|
}
|