Bug 60556 - [1.5] Collections.unmodifiableList(List<A>)
Summary: [1.5] Collections.unmodifiableList(List<A>)
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-30 07:55 EDT by Michael Forster CLA
Modified: 2005-01-11 11:02 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 Michael Forster CLA 2004-04-30 07:55:03 EDT
Not sure, whether this is a bug or simply not implemented, but this code: 

    List<A> x(List<A> list)
    {
        return Collections.unmodifiableList(list);
    }

gives the following error messages:

 * The method unmodifiableList(List<? extends T>) in the type Collections is
   not applicable for the arguments (List<A>)
 * Type mismatch: cannot convert from List<T> to List<A>

The J2SDK 1.5.0b1 compiler was able to compile my code. I am using Build 
I20040428 with Cheetah04.
Comment 1 Philipe Mulet CLA 2004-05-01 09:56:11 EDT
Type inference did not pattern match correctly: List<? extends T> with 
List<X>, and failed to consider T as substituted with X.

Fixed. Added regression test GenericTypeTest#test152.
Comment 2 Philipe Mulet CLA 2004-05-01 09:56:32 EDT
Fixed