Bug 85930 - [1.5][compiler] Incorrect warning given accessing enum in generic interface
Summary: [1.5][compiler] Incorrect warning given accessing enum in generic interface
Status: RESOLVED DUPLICATE of bug 84944
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-20 06:08 EST by Nik Silver CLA
Modified: 2005-02-22 19:13 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 Nik Silver CLA 2005-02-20 06:08:44 EST
Entering the following code gives a warning icon in the LHS margin in 3.1M5:

interface Callable<T>
{
    public enum Result { GOOD, BAD };
    public Result call(T arg);
}

public class StaticExample implements Callable<String>
{
    public Result call(String arg) { return Result.GOOD; } // Warning line
}

The warning appears for the token "Result" on the line indicated. It reads "Type
safety: The return type Callable<String>.Result for call(String) from the type
StaticExample needs unchecked conversion to conform to Callable.Result from the
type Callable<T>."

However compiling this with "javac -Xlint StaticExample.java" gives no warnings.
Comment 1 Philipe Mulet CLA 2005-02-20 06:56:17 EST
Reproduced. Indeed the warning makes no sense here.
Comment 2 Philipe Mulet CLA 2005-02-22 19:13:56 EST
Added GenericTypeTest#test518

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