| Summary: | [1.5][compiler] ecj vs. javac differ for varargs overloading | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Ayushman Jain <amj87.iitr> |
| Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> |
| Status: | VERIFIED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | jarthana, Olivier_Thomann, thanson |
| Version: | 3.7 | ||
| Target Milestone: | 3.8 M4 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
I would target 3.7.1 to match the Java 7 behavior when the Java 7 support is released. *** Bug 96330 has been marked as a duplicate of this bug. *** Don't expect to get to this before 3.8. Retargetting. Also see this Stackoverflow thread for more details from people who know more about this than me: http://stackoverflow.com/q/7918134/623612 (In reply to comment #4) > Also see this Stackoverflow thread for more details from people who know more > about this than me: > > http://stackoverflow.com/q/7918134/623612 Posted on the wrong bug, sorry. (In reply to comment #0) > javac bug http://bugs.sun.com/view_bug.do?bug_id=5088429. Just a note that the "Interesting corner case:" cited in the page above continues to elicit an ambiguous call error. So does the following snippet: public class X { public static void main(String[] s) { count(1); count(1, 1); count(1, 1, 1); } public static void count(int ... values) {} public static void count(int i, int ... values) {} } Combined fix and tests for bug 346039 and bug 346038 have been released into 3.8 stream via 85f48e0f08275e1f81e9995073d5c4f69bfd0707. Some existing tests had to be remastered - in all instances the behavior matches JDK 7b147 behavior. Verified for 3.8M4 with build I20111204-2000. |
The following fails to compile with build I20110514-0800 class Test implements IClass{ Test(IClass c, Test t, IType... args) {} Test(IClass c, IType... args) {} public static void main(String args[]) { IClass c = null; Test t = null; Test t2 = new Test(c, t); // incorrectly flagged ambiguous } } interface IType{} interface IClass extends IType{} ECJ is consistent with javac 5,6 but not with javac7b138. This was fixed in javac bug http://bugs.sun.com/view_bug.do?bug_id=5088429.