Bug 59147

Summary: [1.5] Compiler rejects correct code with wildcards and raw types
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2004-04-19 16:21:15 EDT
Cheetah-03

The following program should compile clear.


import java.util.ArrayList;
import java.util.List;

public class Z <T extends List> { 
    T t;
    public static void main(String[] args) {
        foo(new Z<ArrayList>().set(new ArrayList<String>()));
        System.out.println("SUCCESS");
    }
    Z<T> set(T t) {
        this.t = t;
        return this;
    }
    T get() { 
        return this.t; 
    }
    
    static void foo(Z<? super ArrayList> za) {
        za.get().isEmpty();
    }
}
Comment 1 Philipe Mulet CLA 2004-04-21 12:44:38 EDT
Fixed. Tuning in wildcards was necessary.
Added regression test GenericTypeTest#test134
Comment 2 Philipe Mulet CLA 2004-04-21 12:50:09 EDT
Fixed