Bug 105284

Summary: [1.5][compiler] Autoboxing: Type mismatch
Product: [Eclipse Project] JDT Reporter: Martin Trummer <martin.trummer>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: bmiller
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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