Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326854 - give type constraint of containment higher precedence
Summary: give type constraint of containment higher precedence
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: b3 (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-02 20:51 EDT by Henrik Lindberg CLA
Modified: 2017-09-13 11:52 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Lindberg CLA 2010-10-02 20:51:40 EDT
When inferring the type of a List or Map with undeclared type, a type constrain should be given higher precedence than inferring the type from the contents of the list.

i.e.
List<String> a = ["hello", 2]; 

Should produce error that 2 is not compliant with the list type (as opposed to stating that a List<Object> can not be assigned to a List<String>.
Comment 1 Henrik Lindberg CLA 2010-10-02 20:54:11 EDT
Implemented for List in revision 1325.
Comment 2 Henrik Lindberg CLA 2010-10-02 21:11:31 EDT
Implemented for Map in revision 1326.