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

Bug 361483

Summary: Plus operation adds to source and target arrays
Product: z_Archived Reporter: broy2
Component: EDTAssignee: Project Inbox <edt.javagen-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jeffdouglas
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description broy2 CLA 2011-10-19 18:33:16 EDT
Debug the program below.
After the plus statement, "Meredith" has been added to newList and myNames.
Should only be newList.

program plusProb type BasicProgram {}
    myNames string[] =["Carolina", "State", "Duke"];
    element string = "Meredith";
    newList string[];
    function main()
        newList = myNames + element;  
    end
end

/**
 * {@Operation +} Creates a new list consisting of the first operand's elements
 * followed by the second operand.  The assigning form of the operator (+=) does 
 * not create a new list: the appendElement function is used to add the second 
 * operand to the end of the first operand.
 */
static function $Plus(lvalue EList in, rvalue EAny in) returns (EList) {@Operation{"+"}};
Comment 1 Jeff Douglas CLA 2011-10-26 14:10:19 EDT
fixed
Comment 2 broy2 CLA 2011-11-03 11:22:14 EDT
Verified in 20111103 build.