Bug 141330 - [1.5][compiler] Suspicious error message for type mismatch
Summary: [1.5][compiler] Suspicious error message for type mismatch
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-11 11:40 EDT by Philipe Mulet CLA
Modified: 2006-09-11 10:25 EDT (History)
0 users

See Also:


Attachments
Proposed patch (4.23 KB, patch)
2006-05-11 12:13 EDT, Philipe Mulet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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