Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358961

Summary: Can't assign empty array literal to array
Product: z_Archived Reporter: Justin Spadea <jspadea>
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

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