Bug 83993

Summary: Inner enum types inherit type parameters
Product: [Eclipse Project] JDT Reporter: Christian Plesner Hansen <stderr>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: minor    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Christian Plesner Hansen CLA 2005-01-29 13:30:29 EST
When declaring an enumeration within a class, the type parameters of the class
are inherited.  For instance here:

public class SuperClass<Type> {
    static enum Inner { ELM }
    Inner getInner() { return null; }
}

public class SubClass extends SuperClass<String> {
    public Inner getInner() {
        return Inner.ELM;
    }
}

This causes an error because the type of ELM is given type
SuperClass<Type>.Inner but and the return type in the subclass is taken to be
SuperClass<String>.Inner.  That doesn't seem right.  Oddly enough, this is not a
problem when the classes are in the same file.
Comment 1 Philipe Mulet CLA 2005-01-30 03:03:55 EST

*** This bug has been marked as a duplicate of 82349 ***