Bug 59147 - [1.5] Compiler rejects correct code with wildcards and raw types
Summary: [1.5] Compiler rejects correct code with wildcards and raw types
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-19 16:21 EDT by Philipe Mulet CLA
Modified: 2005-01-11 11:01 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 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