Community
Participate
Working Groups
The attached classes compile fine on Eclipse 3.4.1 on Vista32 JRE 6, but does not compile under Eclipse 3.2 or 3.4.0 on Ubuntu. The classes compile fine with Sun JDK. If generics is removed, then the classes would compile.
Created attachment 134030 [details] The base class and subclass. Somehow the attachment didn't go through.
Reassigning to "Core" since this has nothing to do with APT. Here are the attached classes, for convenience's sake: package Experimental; public class InferenceBase<T extends Comparable<T>> { public class InferenceNode { T x; InferenceNode next; } } public class InferenceChild<T extends Comparable<T>> extends InferenceBase<T> { public static void main(String[] args) { return; } public static <E extends Comparable<E>> void test(InferenceChild<E>.InferenceNode a) { test(a.next); return; } } Xiaoyang, could you please indicate what compiler error you are getting?
(In reply to comment #2) No error on javac or Eclipse 3.4.1 on Vista. The exact error message given by Eclipse 3.4 on Ubunto is the following: > test(a.next); ^^^^^^^^^^Bound mismatch: The generic method test(InferenceChild<E>.InferenceNode) of type InferenceChild<T> is not applicable for the arguments (InferenceBase<T>.InferenceNode). The inferred type Comparable<Comparable<E>> is not a valid substitute for the bounded parameter <E extends Comparable<E>>
So a bug was fixed in 3.4.1. The eclipse compiler (since 3.4.1) no longer produces an error in this case, just as javac does not. Please reopen if we missed something.
(In reply to comment #3) > > No error on javac or Eclipse 3.4.1 on Vista. > Verified by reporter