Community
Participate
Working Groups
Build ID: M20080911-1700 Steps To Reproduce: 1.Paste the tree interfaces below. 2.See how Eclipse compiles them OK. 3.Check with javac from Sun's JDK. It returns $ javac -d ../temp/classes ch/arrenbrecht/eclipsequirks/covariant/*.java ch/arrenbrecht/eclipsequirks/covariant/IBoth.java:3: types ch.arrenbrecht.eclipsequirks.covariant.ITwo and ch.arrenbrecht.eclipsequirks.covariant.IOne are incompatible; both define foo(), but with unrelated return types public interface IBoth extends IOne, ITwo ^ 1 error $ javac -version javac 1.6.0_0-internal More information: --- package ch.arrenbrecht.eclipsequirks.covariant; public interface IOne { IOne foo(); } --- package ch.arrenbrecht.eclipsequirks.covariant; public interface ITwo { ITwo foo(); } --- package ch.arrenbrecht.eclipsequirks.covariant; public interface IBoth extends IOne, ITwo { IBoth foo(); } ---
Interestingly javac7 behaves like we do. Kent - is this a compliance-driven behavior ? Or do we have the right behavior, and they only fixed it from 1.7 on ?
Feels like our behavior is correct, and Javac6 wrong since IBoth is actually a good fit for both supertype #foo method return types.
I certainly agree that Eclipse's behaviour is better. Javac is causing me some pain with this. :(
Closing as a javac bug See the additional testcases in the comment section http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6294779 I really like the last comment ;)
To change resolved state
Closing as invalid since its not an eclipse bug, but is a javac bug
Verified for 3.5M5.