Bug 277874

Summary: [1.5][compiler] Error not shown in IDE: Generic Enum assignment
Product: [Eclipse Project] JDT Reporter: Martin Kunert <martin.kunert>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED NOT_ECLIPSE QA Contact:
Severity: major    
Priority: P3 CC: Olivier_Thomann
Version: 3.4.2   
Target Milestone: 3.5 RC3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
class which does not compile with JDK but in IDE none

Description Martin Kunert CLA 2009-05-26 11:27:43 EDT
Build ID: M20090211-1700

Steps To Reproduce:
Eclipse IDE does not show the compiler error, when running javac.exe the compiler generates the follwing error log:

GenericEnums01.java:6: <T>getEastingUnit(java.lang.Class<T>) in buggy.GenericEnums01 cannot be applied to (java.lang.Class<capture of ?>)
                Enum<?> a = this.getEastingUnit(eastingUnit.getDeclaringClass());


More information:
Comment 1 Martin Kunert CLA 2009-05-26 11:29:42 EDT
Created attachment 137171 [details]
class which does not compile with JDK but in IDE
Comment 2 Olivier Thomann CLA 2009-05-26 13:56:30 EDT
javac 1.6_14 or javac 7.0b59 also compile this code fine.
Comment 3 Kent Johnson CLA 2009-05-26 14:22:42 EDT
This is a bug in javac 1.5 that has since been fixed in the current javac 6 & 7 builds.

Eclipse is compiling this code without errors, as are javac 6 & 7.
Comment 4 Olivier Thomann CLA 2009-05-27 15:27:48 EDT
Verified for 3.5RC3 using I20090526-2000.