Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 467745

Summary: [compiler] Missing "The method * is ambiguous for the type *" for parameter types with unresolved raw supertype
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Sasikanth Bharadwaj <sasikanth.bharadwaj>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jarthana
Version: 4.5   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug
Bug Depends on: 464229    
Bug Blocks:    

Description Markus Keller CLA 2015-05-20 14:20:26 EDT
The fix for bug 464229 re-introduced a variant of the problem from bug 206930.

From bug 464229 comment 13:

Created attachment 253605 [details]
projects to reproduce concern from bug 464229 comment 11

Here are 2 projects that reproduce the concerns I mentioned in bug 464229 comment 11.

- Out of the box, there's a (valid) ambiguous method error in /1.5/src/test066/Main.java. This error disappears in incremental builds (similar to bug 460993).

- Now modify /1.5/.classpath:
  - deactivate <classpathentry kind="src" path="reqSrc"/>
  - activate   <classpathentry kind="lib" path="/1.5req/bin/"/>

=> problem disappears, since Scope#findExactMethod(..) now doesn't return null when processing this ReferenceBinding r:
public class test066.MyList
	extends Unresolved type java.util.ArrayList

The hierarchy is not connected, and only the supertype is the raw type (not the type MyList itself), so the new findExactMethod(..) thinks it found an exact method.

Conclusion: There are situations where the hierarchy needs to be connected in order to find out whether we deal with an ambiguous method invocation due to a raw supertype in an overloaded method signature.

I think a correct fix would have to decide in Scope#findExactMethod(..) whether the ambiguous method case could show up. If it could, then the hierarchy needs to be connected and clients have to add the necessary dependencies to make that work.
Comment 1 Jay Arthanareeswaran CLA 2015-05-26 02:15:49 EDT
Putting this in 4.6 radar.
Comment 2 Sasikanth Bharadwaj CLA 2016-04-06 05:22:28 EDT
Unlikely for 4.6, moving out
Comment 3 Sasikanth Bharadwaj CLA 2017-05-15 05:12:39 EDT
Moving out of 4.7
Comment 4 Eclipse Genie CLA 2019-07-18 12:44:12 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.