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

Bug 359560

Summary: set values block creating statement blocks with reference to local variable
Product: z_Archived Reporter: Jeff Douglas <jeffdouglas>
Component: EDTAssignee: Project Inbox <edt.compiler-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P1 CC: pharmon, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jeff Douglas CLA 2011-09-30 09:32:57 EDT
Paul, the XML created by this sample code is creating 2 statement blocks inside the set values, and the local variable eze$SettingTarget1 is defined in the 1st statement block, but referenced in the 2nd. The problem is that any statement block gets generated with { } around it, making the local variable not visible to the 2nd block.

package acme.driver;

record Employee
    EmpNo EmpNumber;
    array EmpNumber[] = new EmpNumber[];
    dict Dictionary{};
    LastName string;
end

record EmpNumber
    department string{JSONName = "dept"};
    value int{JSONName = "empno"};
end

program bug3
emp1 Employee{EmpNo{department = "salesx", value = 10}, LastName = "Smithx"};
emp2 Employee{};
empAny any = new Employee{EmpNo{department = "salesy", value = 10}, LastName = "Smithy"};//, dict{abc="abc",cde="cde"} };
empAny2 any = new Employee{};
	function main()
	end
end
Comment 1 Paul Harmon CLA 2011-10-10 14:03:07 EDT
I have reworked the nested setvalues code so that this works correctly now.

Changes primarily to:
Egl2MofMember
Egl2MofExpression
Comment 2 Lisa Lasher CLA 2011-11-09 14:13:29 EST
This high severity defect was fixed several weeks ago, so I am closing.