Bug 87267 - [1.5][compiler] cast from Integer[] to int[] should fail
Summary: [1.5][compiler] cast from Integer[] to int[] should fail
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-07 09:54 EST by Philipe Mulet CLA
Modified: 2005-03-31 09:44 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philipe Mulet CLA 2005-03-07 09:54:07 EST
Build 3.1m5a

The following code should be rejected:
public class X {
	public static void main(String[] args) {
		Integer[] integers = {};
		int[] ints = (int[]) integers;
	}
}
Comment 1 Philipe Mulet CLA 2005-03-07 10:00:32 EST
Code was incorrectly allowed due to autoboxing when recursing in array element
types.
Added AutoboxingTest#test100.
Fixed
Comment 2 David Audel CLA 2005-03-31 09:44:19 EST
Verified in I20050330-0500