Bug 106090 - [generics] Method invocation resolution depends on declaration order
Summary: [generics] Method invocation resolution depends on declaration order
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-04 15:42 EDT by Alex Hudspith CLA
Modified: 2006-03-29 05:32 EST (History)
3 users (show)

See Also:


Attachments
Source for MethodsAB and MethodsBA (1.06 KB, application/octet-stream)
2005-08-04 15:44 EDT, Alex Hudspith CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Hudspith CLA 2005-08-04 15:42:10 EDT
The two attached classes MethodsAB and MethodsBA are identical except for the
ordering of the two overloadings of 'method'. Compiling and running these in
Eclipse gives different results for each. MethodsAB outputs "Method A" whereas
MethodsBA outputs "Method B". Sun's javac 1.5.0_04 generates code that outputs
"Method B" for both.

I couldn't say for certain which method should be called (which is "most
specific" in the sense of JLS3 15.12.2.5?), but the result should at least be
the same in each case.
Comment 1 Alex Hudspith CLA 2005-08-04 15:44:29 EDT
Created attachment 25708 [details]
Source for MethodsAB and MethodsBA

Source attached.
Comment 2 Kent Johnson CLA 2005-09-19 15:42:43 EDT
Will be fixed when we take care of tieBreak methods as described in bug 100869
Comment 3 Philipe Mulet CLA 2005-09-23 06:18:44 EDT
Fix will not be ready for 3.1.1, removing target milestone "3.1.1"
Comment 4 Philipe Mulet CLA 2006-03-03 12:09:47 EST
Kent - using HEAD we complain about ambiguities in both cases.
Comment 5 Kent Johnson CLA 2006-03-28 10:45:30 EST
Finally fixed.

Added AmbiguousMethodTest test011
Comment 6 Frederic Fusier CLA 2006-03-29 05:32:43 EST
Verified for 3.2 M6 using build I20060329-0010.