Summary: | [1.5][compiler] false compiler error on ?: ternary operator with boxing | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Alexey Radul <axofch> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | VERIFIED FIXED | QA Contact: | |
Severity: | minor | ||
Priority: | P3 | CC: | zorzella |
Version: | 3.1 | ||
Target Milestone: | 3.1.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Alexey Radul
2005-06-14 14:32:03 EDT
Indeed, we did miss this scenario. Boxing is indicated in this case. Added AutoboxingTest#test109. Fixed is it possible to turn off that kind of error? Most of my code does not compiles due to this bug. You could insert an ugly cast to workaround the bug. We will try to post you some patch. public class X { public static void main(String[] args) { int foo = 0; String bar = "zero"; System.out.println( (foo != 0) ? (Integer)foo : bar ); } } Verified in 3.2 M1 with build I20050808-2000. *** Bug 106499 has been marked as a duplicate of this bug. *** Verified using M20050923-1430 for 3.1.1 |