Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 166005

Summary: [compiler] Fup of bug 165917, improve problem range for incorrect number of type arguments
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: philippe_mulet, stephan.herrmann
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Olivier Thomann CLA 2006-11-27 22:51:15 EST
See org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest#test0059/test0060:

instead of:
"----------\n" + 
"1. ERROR in test\\X.java (at line 7)\n" + 
"	X<String, Number, Integer> x;\n" + 
"	^\n" + 
"Incorrect number of arguments for type X<A1,A2,A3,A4>; it cannot be parameterized with arguments <String, Number, Integer>\n" + 
"----------\n"

we should report:
"----------\n" + 
"1. ERROR in test\\X.java (at line 7)\n" + 
"	X<String, Number, Integer> x;\n" + 
"	^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
"Incorrect number of arguments for type X<A1,A2,A3,A4>; it cannot be parameterized with arguments <String, Number, Integer>\n" + 
"----------\n"

or even better:
"----------\n" + 
"1. ERROR in test\\X.java (at line 7)\n" + 
"	X<String, Number, Integer> x;\n" + 
"	 ^^^^^^^^^^^^^^^^^^^^^^^^^\n" + 
"Incorrect number of arguments for type X<A1,A2,A3,A4>; it cannot be parameterized with arguments <String, Number, Integer>\n" + 
"----------\n"
since the problem concerns the type arguments.
Comment 1 Eclipse Genie CLA 2020-01-21 13:50:05 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Stephan Herrmann CLA 2020-01-21 16:01:44 EST
I made a quick check if this is a low hanging fruit, but the parser doesn't even set the position of the closing '>' (updating the parser comes with its own risks). So rather than guessing that postion (e.g, from the last type argument + 1) I'm fine with leaving the reporting as it is.