Community
Participate
Working Groups
The following code does not compile with the Eclipse Compiler (3.1M6 and I20050426-1700), but it does with the Sun JDK Compiler (1.5.0_02). ---------------------------------------------------------------------- package bugreport; import java.util.EnumSet; import java.util.Set; public class Bug<T> { enum E { A, B } Set<E> set = EnumSet.of(E.A); } ---------------------------------------------------------------------- The error message is: Type mismatch: cannot convert from EnumSet<Bug<T>.E> to Set<Bug.E>
Interestingly, removing the <T> parameter from type Bug makes the problem go away.
Added EnumTest#test102. Several issues got surfaced. Lack of conversion to raw type for implict enum references (through type of enum constant, or argument in supertype Enum<E>). Also the qualified name E.A needed some intermediate raw conversion. Fixed
Verified in I20050510-0010