JDK-8004102 : Add support for generic functional descriptors
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-11-28
  • Updated: 2013-06-11
  • Resolved: 2012-11-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b68Fixed
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.