Community
Participate
Working Groups
Hi, assume these two interfaces: public interface Transformable<T extends Transformable> { public T transform(); } public interface Volume<V extends Volume> extends Transformable<V> { // public V transform(); } Note that the line "public V transform();" is only a comment. The interface Volume inherits the method transform from Transformable<V> - so transform() should return something that extends Volume since V is known to extend Vector. Instead the code: Volume v1 = null; Volume v2 = v1.transform(); does not compile. v1.transform() returns Transformable instead of Volume. I know that the code Volume<Volume> v1 = null; Volume v2 = v1.transform(); compiles fine, but if you comment out the "public V transform();", you will see that the first code-example compiles clean again. I think that this is a bug in both compilers: javac and JDT. The "public V transform()" should be generated automatically if this is the only possibility for generating proper byte-code. Currently JDT confirms to the behaviour of javac.
This is the essence of raw types and erasure mechanism. What specific portion of the JLS 3rd edition do you think our compiler contradict ? If this is a language semantic debate, then this is the wrong location for complaining; since the spec is not owned by Eclipse. Can you please clarify?
Closing as invalid. Added GenericTypeTest#test828.