Bug 105284 - [1.5][compiler] Autoboxing: Type mismatch
Summary: [1.5][compiler] Autoboxing: Type mismatch
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 critical (vote)
Target Milestone: 3.1.1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-27 07:12 EDT by Martin Trummer CLA
Modified: 2005-09-26 11:58 EDT (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 Martin Trummer CLA 2005-07-27 07:12:44 EDT
Eclipse V3.1.0 Build I20050627-1435

Problem: compile error with the following code

public class Test {
	public static void main(String[] args) {
		Short s;
		s = 5;  // Type mismatch: cannot convert from int to Short
	}
}

Works fine with javac (JDK 1.5.0_02).
Comment 1 Martin Trummer CLA 2005-08-03 16:58:59 EDT
Same type mismatch problem with array initializers:

Short[] shortArray = { 7 };  // Type mismatch
Short[] shortArray = new Short[] { 7 };  // Type mismatch

Both statements work fine with javac (JDK 1.5.0._02)
Comment 2 Philipe Mulet CLA 2005-08-12 10:38:08 EDT
Indeed, we were only tolerating these in variable declarations.
Fixed.
Added AutoboxingTest#test112-113
Comment 3 David Audel CLA 2005-09-21 10:09:59 EDT
Verified in I20050920-0010 for 3.2M2
Comment 4 David Audel CLA 2005-09-26 11:58:54 EDT
Verified using M20050923-1430 for 3.1.1