| Summary: | Incorrect comment | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Caleb <calebcjh> |
| Component: | UI | Assignee: | platform-ua-inbox <platform-ua-inbox> |
| Status: | CLOSED INVALID | QA Contact: | |
| Severity: | minor | ||
| Priority: | P3 | CC: | cgold, deepakazad |
| Version: | 3.3.1 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Caleb
Assigning to JDT (In reply to comment #0) > When the following code is entered: > > int k = 1; > k = ++k; > > Eclipse incorrectly indicates an error with the message "The assignment to > variable k has no effect" when actually, k has been incremented after those two > statements. int k = 1; ++k; This is same as above code, k is 2 in both cases > The code: > > int m = 2; > m = m++; > > does not have any effect, but is not detected by Eclipse as the above-mentioned > message did not show up. In this case m is 2. int m = 2; m++; In this case m becomes 3. Note the difference in post increment and pre increment operators. |