compiler bug with generic / return type override (disagree with sun javac) [message #258638] |
Wed, 11 February 2009 20:56  |
Eclipse User |
|
|
|
This code give no error with sun javac 1.5.0_17 and 1.6.0_12,
but error in eclipse 3.4 (org.eclipse.jdt.core_3.4.2.v_883_R34x.jar).
[ no, I didn't
----------
1. ERROR in ClassC.java (at line 1)
public class ClassC<T> extends ClassB<T> implements InterfaceA<T> {
^^^^^^
The return type is incompatible with InterfaceA<T>.get(T),
ClassB<T>.get(Object)
----------
1 problem (1 error)
========= source code =========
public interface InterfaceA<T> {
public int get(T o);
}
public class ClassB<T> {
T get(Object o) {
return null;
}
}
public class ClassC<T> extends ClassB<T> implements InterfaceA<T> {
public int get(T o) {
return 0;
}
}
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03477 seconds