Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359560 - set values block creating statement blocks with reference to local variable
Summary: set values block creating statement blocks with reference to local variable
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-30 09:32 EDT by Jeff Douglas CLA
Modified: 2017-02-23 14:18 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 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.