Community
Participate
Working Groups
N20080910-2000 Compiler must not allow unboxing conversion from Cloneable to char. public class Try { public static void main(String[] args) { char c; Cloneable cloneable= new ArrayList(); c= cloneable; System.out.println(c); } } JDT/Core from HEAD compiles this without an error, but I20080903-1200 and javac (1.6.0_07) both correctly say "Type mismatch: cannot convert from Cloneable to char". Same problem with boolean, long, double. Same problem when assigning a Serializable to a byte. This causes a test failure in JDT/UI: bool= cloneable c= cloneable l= cloneable d= cloneable b= serializable junit.framework.AssertionFailedError: bool= cloneable c= cloneable l= cloneable d= cloneable b= serializable at org.eclipse.jdt.ui.tests.core.TypeRulesTest.testIsAssignmentCompatible(TypeRulesTest.java:211)
Oh, sorry. It's actually fixed in HEAD.
Being curious. Why are you saying it got fixed in HEAD ? To my knowledge it was never broken. I checked all the releases back until 3.3.0, and it was always fine. Is this INVALID ?
It was broken in N20080910-2000: http://download.eclipse.org/eclipse/downloads/drops/N20080910-2000/testresults/html/org.eclipse.jdt.ui.tests_win32.win32.x86.html I tried to reproduce the test failure in that build (without jdt.core from HEAD), and it really failed. But when I went and ran the test in HEAD, it was green again.
I think that WORKSFORME is the correct resolution whether it didn't work at one point in time or it always worked. WORKSFORME just tells that no action was taken to fix the problem by JDT/Core.
Verified for 3.5M2 using I20080914-2000.