JDK-8035761 : javac, assertion error while accessing a member of a wildcard site during overload resolution
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2014-02-25
  • Updated: 2014-07-16
  • Resolved: 2014-07-16
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 9
9Resolved
Related Reports
Duplicate :  
Description
This code:

class ExceptionInferenceBug {

    interface PartialFunction<T, V> {
        V apply(T paramT);
    }

    interface Function<T, V> extends PartialFunction<T, V> {
        V apply(T paramT);
    }

    class O {}

    static <T, V> void run(Function<? super O, V> function) {}
    static <T, V> void run(PartialFunction<? super O, V> function) {}

    public static void main(String[] args) {
        run(t -> t.toString()); 
    }
}

makes javac generate an assertion error. If the second run method is commented out there is no error.

reported in lambda-dev list: http://mail.openjdk.java.net/pipermail/lambda-dev/2014-February/011910.html
Comments
can't reproduce anymore with last javac 9
27-06-2014

similar test case provided by the user: class JavacBug { interface Function<T, V> extends PartialFunction<T, V> { V apply(T paramT); } interface PartialFunction<T, V> { V apply(T paramT) throws Exception; } interface Runner { <T> T run(Function<? super Object, T> tFunction); } public static void main(String[] args) { Runner runner = null; runner.run(tx -> { tx.hashCode(); return null; }); } }
22-04-2014

Release team: Approved for deferral.
25-02-2014