Bug 133351

Summary: [compiler] No effect assignment diagnosis range isn't correct
Product: [Eclipse Project] JDT Reporter: David Audel <david_audel>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: philippe_mulet
Version: 3.2   
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Audel CLA 2006-03-27 09:20:04 EST
(from bug 100369 test case)

build I20060327-0010

------------------------------------------
int length2 = length2 = 0; // first problem

int length3 = 0;
length3 = length3 = 0; // second problem
------------------------------------------

Only the variable name declation has a red squiggle for the first error but all the assigment has a red squggle for the second error.

All the assignment should be underline for the first error.
Comment 1 Olivier Thomann CLA 2006-04-10 11:04:37 EDT
Candidate for RC1?
Comment 2 Philipe Mulet CLA 2006-04-10 11:28:18 EDT
+1 for 3.2RC1, if not harmful to UI.
Comment 3 Olivier Thomann CLA 2006-04-10 12:16:15 EDT
What do you expect to be underlined in the first case ?
"length2 = length2 = 0" or "int length2 = length2 = 0;" ?
Comment 4 David Audel CLA 2006-04-10 12:23:07 EDT
I prefer "length2 = length2 = 0", but i think that both are good.
Comment 5 Olivier Thomann CLA 2006-04-10 15:08:45 EDT
Fixed and released in HEAD.
The ranges are now consistent.

In:
int length2 = length2 = 0; // first problem

it underlines: length2 = length2 = 0

In:
int length3 = 0;
length3 = length3 = 0; // second problem
it underlines: length3 = length3 = 0
Comment 6 Olivier Thomann CLA 2006-04-10 15:11:07 EDT
Added regression test in org.eclipse.jdt.core.tests.compiler.regression.AssignmentTest.test045 and updated existing tests.
All JDT/Core tests passed.
Comment 7 David Audel CLA 2006-04-13 10:53:04 EDT
Verified for 3.2 RC1 using build I20060413-0010