Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 358961 - Can't assign empty array literal to array
Summary: Can't assign empty array literal to array
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-26 15:01 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:17 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Spadea CLA 2011-09-26 15:01:22 EDT
ia int[] = [];

Type mismatch: cannot convert from EList<EAny> to EList<Integer>
Comment 1 Jeff Douglas CLA 2011-09-30 14:26:55 EDT
The problem is because this statement:

i int[] = [];

goes into the ArrayLiteralTemplate and gets the type of the array, which has no entries, so it is defaulting to Any.

I think the only way of solving this is to check for this condition in Reorg code and assign the type to the array, using the assignment LHS as the type.
Comment 2 Jeff Douglas CLA 2011-09-30 22:03:06 EDT
fixed
Comment 3 Justin Spadea CLA 2011-11-04 14:16:11 EDT
Verified