Community
Participate
Working Groups
BETA_JAVA8 The new JLS 8.4.5 has a slightly different way of finding out duplicate method return types so that the following case which didn't compile with JDK <= 1.7, should start to compile with JDK 1.8. This should be fixed in Eclipse also for compliance > 1.7 package p; import java.util.List; interface X { <T> List<T> m(); } interface Y<K> { List<K> m(); } interface Z extends X, Y {} // error here JDK8 ver. b40 compiles this case
This code compiles with JDK5,6,7,8. Eclipse compiles at 1.5, 1.6 modes.
(In reply to comment #0) > BETA_JAVA8 > > The new JLS 8.4.5 has a slightly different way of finding out duplicate > method return types so that the following case which didn't compile with JDK > <= 1.7, should start to compile with JDK 1.8. This should be fixed in > Eclipse also for compliance > 1.7 > > package p; > > import java.util.List; > > interface X { <T> List<T> m(); } > interface Y<K> { List<K> m(); } > interface Z extends X, Y {} // error here > > JDK8 ver. b40 compiles this case At the level of Z, the methods have unrelated signatures and it is OK to not complain. To have determined right at compile time of Z that this interface is not implementable by anyone would be nice, but calls for a bit of AI. The programmer will anyway know soon, soon enough ;-) That said per comment#1, this code has been compiling all along with eclipse and javac. So it is not a surprise that 8b40 is compiling it. Test released via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=1fd2e6f3ce4f8526b5b34eb193c45912e205d203
Verified for 4.3 M6 using build I20130310-2000