Description
A generic functional descriptor should be a legal target for a method reference. The following code should compile:
interface F {
<X> void m(X x);
}
class Test {
<Z> void g(Z z) { ... }
void test() {
F f = this::g;
f.m(1); //ok X inferred as Integer
f.m(""); //ok X inferred as String
}
}
Note: generic methods are still _not_ legal target for lambda expressions, as per EDR.
interface F {
<X> void m(X x);
}
class Test {
<Z> void g(Z z) { ... }
void test() {
F f = this::g;
f.m(1); //ok X inferred as Integer
f.m(""); //ok X inferred as String
}
}
Note: generic methods are still _not_ legal target for lambda expressions, as per EDR.