Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361483 - Plus operation adds to source and target arrays
Summary: Plus operation adds to source and target arrays
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-19 18:33 EDT by broy2 CLA
Modified: 2017-02-23 14:19 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.