Bug 427115

Summary: [1.7-][compiler] Compiler mishandles most-specific method test
Product: [Eclipse Project] JDT Reporter: Srikanth Sankaran <srikanth_sankaran>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: NEW --- QA Contact: Sasikanth Bharadwaj <sasikanth.bharadwaj>
Severity: normal    
Priority: P3 CC: daniel.smith, manoj.palat, srikanth_sankaran
Version: 4.3.1Keywords: helpwanted
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X   
Whiteboard: stalebug
Bug Depends on: 426521    
Bug Blocks:    

Description Srikanth Sankaran CLA 2014-01-31 08:03:36 EST
+++ This bug was initially created as a clone of Bug #426521 +++

The following produces a compiler error from javac, but compiles in Eclipse:

import java.util.List;

class Test {
    <U> void m(List<U> l, U v) { }

    <V> void m(List<V> l1, List<V> l2) { }

    void test(List<Object> l) {
        m(l, l); //JDK 6/7 give ambiguity here - EJC compiles ok
    }
}

Both methods are applicable (U and V both inferred as Object); neither is more specific than the other, per JLS 15.12.2.5 (in particular, no u can be inferred such that List<V> <: List<u> _and_ List<V> <: u).

See also this javac bug, which was closed as "not an issue":
https://bugs.openjdk.java.net/browse/JDK-7031404
Comment 1 Manoj N Palat CLA 2018-05-17 03:23:48 EDT
bulk move out of 4.8
Comment 2 Manoj N Palat CLA 2018-08-16 00:06:26 EDT
Bulk move out of 4.9
Comment 3 Eclipse Genie CLA 2020-09-11 13:44:08 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 4 Eclipse Genie CLA 2023-01-13 16:42:53 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.