Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352024 - Resolution of compound assignment operators
Summary: Resolution of compound assignment operators
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Justin Spadea CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-13 15:48 EDT by Matt Heitz CLA
Modified: 2017-02-23 14:15 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Heitz CLA 2011-07-13 15:48:09 EDT
When resolving the EGL function for compound assignment operators like "+=" and "::=", the compiler should look for a function for the non-assigning form of the operator.  In other words, when resolving the operation function for "x *= 4", look for the "*" function as if the expression were written "x = x * 4".

This means EGL types don't have to define functions for the assigning form of the operators they support.  This implicit definition saves some keystrokes, but more importantly it eliminates the possibility of mistakes.  There's no way to omit a compound assignment operator or accidentally use a different operand type from the non-assigning operator.

The Assignment class should have a getOperation() method which will retrieve the Operation of a compound assignment.
Comment 1 Justin Spadea CLA 2011-07-15 10:44:31 EDT
API for getOperation()/setOperation() has been added to Assignment.java (and AssignmentImpl.java), as well as Expressions.egl.

If the assignment does not use a compound operator, getOperation() returns null.
Comment 2 Matt Heitz CLA 2011-09-08 13:55:39 EDT
Closing.