Bug 141330

Summary: [1.5][compiler] Suspicious error message for type mismatch
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.2   
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed patch none

Description Philipe Mulet CLA 2006-05-11 11:40:07 EDT
Build 3.2RC4

The code below is expected to report an error. However the message indicates the lub computation is not perfect. It infers:
List<Class<? extends Object>>

where it could achieve:
List<Class<? extends Object&Comparable<?>&Serializable>>

import java.util.*;
public class X {
    public void testBreak() {
        Collection<Class> classes = new ArrayList<Class>();
        List<Class<Object>>  lco = Arrays.asList(String.class, Integer.class, Long.class);
    }
}
Comment 1 Philipe Mulet CLA 2006-05-11 12:03:35 EDT
Added GenericTypeTest#test0984
Comment 2 Philipe Mulet CLA 2006-05-11 12:11:42 EDT
Actually, test is GenericTypeTest#test0985
Comment 3 Philipe Mulet CLA 2006-05-11 12:13:40 EDT
Created attachment 41150 [details]
Proposed patch

Intersection types shouldn't be erased when processed, like type variables.
Comment 4 Philipe Mulet CLA 2006-05-16 10:52:07 EDT
Released for 3.2.1 integration.
Comment 5 Frederic Fusier CLA 2006-06-12 05:17:45 EDT
Released for 3.3 M1 while merging TARGET_321 in HEAD
Comment 6 Frederic Fusier CLA 2006-08-08 06:38:03 EDT
Verified for 3.3 M1 using build I20060807-2000.
Comment 7 David Audel CLA 2006-09-11 10:25:10 EDT
Verified for 3.2.1 using build M20060908-1655