Summary: | [1.5][compiler] Internal compiler error: ClassCastException / ArrayBinding | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | William <william.van.uden> | ||||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||
Severity: | blocker | ||||||||
Priority: | P3 | CC: | jerome_lanneluc, Olivier_Thomann, philippe_mulet | ||||||
Version: | 3.3 | Flags: | philippe_mulet:
pmc_approved+
|
||||||
Target Milestone: | 3.3.2 | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
William
2007-10-26 09:18:50 EDT
Reproduced with HEAD. Added disabled regression test in org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#_test1206 Problem comes from an attempt to substitute a poor method candidate incorrectly (E for Object[] inside a ReferenceBinding[] boom!). The poor candidate is eliminated later on, hence this is still correct code which is mishandled by the compiler. As a workaround (since blocker), you may want to rename one of the 2 methods 'throwE'; e.g. public class Test { public final <E extends Exception> E throwE2 (E ex, Object ... args) throws E { Object [] oar = new Object [0]; return throwE (oar, ex, args); } public final <E extends Exception> E throwE (Object[] oar, E ex, Object ... args) throws E { throw ex; } } Working on a fix. Created attachment 81570 [details]
Possible patch
Not convinced this is the best fix, however it is quite safe.
Other approach would be to simply use TypeBinding[] instead of ReferenceBinding[] for thrown exceptions list... need to see the benefits.
Added GenericTypeTest#test1206-1210 Released for 3.4M4. Fixed Fixed Created attachment 81958 [details]
Patch for 3.3.x
Patch also released for 3.3.2. Fix is trivial, symptoms are bad. +1 for 3.3.2 Verified for 3.4M4 using build I20071210-1800. |