Bug 60556

Summary: [1.5] Collections.unmodifiableList(List<A>)
Product: [Eclipse Project] JDT Reporter: Michael Forster <email>
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 XP   
Whiteboard:

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