Bug 266421

Summary: [1.5][compiler] code compiles correctly in 3.4.1 but gives compilation errors in 3.5M5
Product: [Eclipse Project] JDT Reporter: Al Major <almajor>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: Olivier_Thomann
Version: 3.5   
Target Milestone: 3.5 M6   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Test project that exhibits the problem.
none
Proposed patch and testcase none

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