Bug 83993 - Inner enum types inherit type parameters
Summary: Inner enum types inherit type parameters
Status: RESOLVED DUPLICATE of bug 82349
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: 3.1 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-29 13:30 EST by Christian Plesner Hansen CLA
Modified: 2005-01-30 03:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***