Bug 427115 - [1.7-][compiler] Compiler mishandles most-specific method test
Summary: [1.7-][compiler] Compiler mishandles most-specific method test
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.3.1   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact: Sasikanth Bharadwaj CLA
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on: 426521
Blocks:
  Show dependency tree
 
Reported: 2014-01-31 08:03 EST by Srikanth Sankaran CLA
Modified: 2023-01-13 16:42 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.