Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360722 - can not assign array for array inout and out parameter
Summary: can not assign array for array inout and out parameter
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 blocker (vote)
Target Milestone: ---   Edit
Assignee: Scott Greer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-12 15:54 EDT by Jing Qian CLA
Modified: 2017-02-23 14:15 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jing Qian CLA 2011-10-12 15:54:03 EDT
This is a critical bug, because this blocks many variations (> 15 variations)

Try the following code, you will get exception saying 

Invalid assignment left-hand side for the following line
recArray = new SimpleRecord[0];

both out and inout for this array parameter would give me this error.

same function runs correctly in java

package handlers;

// RUI Handler



//
//

handler h2 type RUIhandler{initialUI =[
            ], onConstructionFunction = start, cssFile = "css/b.css", title = "h2"}

   
	function start()

		simpleRecArray SimpleRecord[];
		initSimpleRecordArray(simpleRecArray);      
		i int = simpleRecArray.getSize();
		sysLib.writeStdout("size: " + i);
		sysLib.writeStdOut(simpleRecArray[i].item1);		
		  
	end
	
	function initSimpleRecordArray(recArray SimpleRecord[] out)
		temp SimpleRecord;
		recArray = new SimpleRecord[0];   ==>Invalid assignment left-hand side
		
		temp.item1 = "Index 1";
		temp.item2 = 10;
		temp.item3 = 99999999.10;
		recArray.appendElement(temp);
		
		temp.item1 = "Index 1";
		temp.item2 = 20;
		temp.item3 = 99999999.20;
		recArray.appendElement(temp);
		
		temp.item1 = "Index 1";
		temp.item2 = 30;
		temp.item3 = 99999999.30;
		recArray.appendElement(temp);
		SysLib.writeStdOut("array size:" + recArray.getSize());
	end	
end


Record SimpleRecord
  item1 string;
  item2 int;
  item3 decimal(10,2);
end
Comment 1 Scott Greer CLA 2011-10-13 21:13:44 EDT
Fixed;  re-factored the logic for initializing arrays to mirror what Java gen does and this allows JS gen to correctly handle the boxed array parm in the testcase.
Comment 2 Jing Qian CLA 2011-11-11 15:25:02 EST
verified with 2011/11/11/0901's build