Community
Participate
Working Groups
Created attachment 84291 [details] Java class triggering eclipse compiler bug Build ID: M20071023-1652 Steps To Reproduce: The attached java class fails to compile in eclipse with compiler error: Type mismatch: cannot convert from EnumGenericsBug<E>.IsABug to EnumGenericsBug.IsABug More information: The class compiles with javac in jdk1.5.0_14,jdk1.6.0_3 and jdk-1.7_oct-2007. Short version of class: import java.util.Arrays; import java.util.List; public class EnumGenericsBug<E> { public static enum IsABug { TRUE, FALSE; } public List<IsABug> getPossibleBugStates() { return Arrays.asList(IsABug.values()); } }
Reproduced in latest.
Added GenericTypeTest#test1123
Created attachment 85073 [details] Proposed patch Problem came from incorrect construction for synthetic enum method types. They were referring to the generic type, instead of referring to a parameterized form of the generic type, and thus did not convert properly from thereon.
Fix is simple, it could easily be backported for 3.3.2.
Perfectly legit code failed to compile. The fix is simple and there is no possible workaround. Requesting approval to backport to 3.3.2.
+1 for 3.3.2.
Released for 3.4M5. Fixed
Released for 3.3.2
Verified for 3.3.2 using build M20080123-0800
Verified for 3.4M5 using I20080204-0010