Community
Participate
Working Groups
I will attach a project and error log. Basically, I get the attached errors in the log when I change line 59 in junit.textui.TestRunner from static public void run(Class testClass) { to static public <T> void run(Class<T> testClass) { The errors are repeated on every rebuild until I change the signature back. I'll look for a smaller test case if I can.
Created attachment 21034 [details] The project, zipped
Created attachment 21035 [details] The error log generated
FYI, if I leave the change in place, and begin to edit other parts of the program, the internal compiler error soon shows up in the Problems View. Double-clicking the error leads to a state in which endless copies of a dialog are created stating 'An internal error occurred during: "Requesting Java AST from selection"'
Which build are you using ?
Reproduced in latest by reverted code to non-generic method, and then turn method into generic form. Clean build did work fine in the first place.
Simpler testcase: public class X { boolean run(X x) { return false; } <T> void run(Class<T> ct) { } public static void main(String[] args) { boolean b = new X().run(new X(){}); } } Fixed in latest. Problem came from considering the generic method with void return type, and trying to infer from expected type (boolean). Added GenericTypeTest#test660 Also enter bug 94928 about consequences of such a compiler failure for IDE.
Actually, bug 94945 relates to consequences of such a compiler failure for IDE.
Verified in I20050510-0010 + JDT/Core v_556