Bug 266421 - [1.5][compiler] code compiles correctly in 3.4.1 but gives compilation errors in 3.5M5
Summary: [1.5][compiler] code compiles correctly in 3.4.1 but gives compilation errors...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-27 00:49 EST by Al Major CLA
Modified: 2009-03-09 14:02 EDT (History)
1 user (show)

See Also:


Attachments
Test project that exhibits the problem. (1.57 KB, application/zip)
2009-02-27 00:49 EST, Al Major CLA
no flags Details
Proposed patch and testcase (2.66 KB, patch)
2009-02-27 11:42 EST, Kent Johnson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Al Major CLA 2009-02-27 00:49:13 EST
Created attachment 126952 [details]
Test project that exhibits the problem.

Build ID: I20090202-1535

Steps To Reproduce:
1. create a java project with files for the following 3 classes (or use the attached Test project).

public abstract class Base<T extends Comparable> {
    abstract public int testM(T val);
}

public class FirstLevel<T extends Comparable> extends Base<T> {
    public int testM(T val) {
        return 0;
    }
}

public class SecondLevel extends FirstLevel<Double> {
    public int caller(Double val) {
        return testM(val);
    }
}

2. under 3.4.1 there are no problems with this code.

3. under 3.5M5, the call to testM from SecondLevel.caller results in the compilation error "The method testM(Double) is ambiguous for the type SecondLevel"


More information:
unless i'm missing something, the 3.5M5 compiler appears to be wrong.
Comment 1 Kent Johnson CLA 2009-02-27 11:42:57 EST
Created attachment 127023 [details]
Proposed patch and testcase
Comment 2 Kent Johnson CLA 2009-02-27 11:59:00 EST
Fix and test released for 3.5M6
Comment 3 Frederic Fusier CLA 2009-03-09 14:02:44 EDT
Verified for 3.5M6 using I20090309-0100