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

Bug 363579

Summary: CONST parameter modifier shouldn't be allowed with the inOut modifier
Product: z_Archived Reporter: Kathy Carroll <carrollk>
Component: EDTAssignee: Project Inbox <edt.compiler-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pharmon
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
eunit library none

Description Kathy Carroll CLA 2011-11-11 07:49:31 EST
This method declaration

    function calledReturning(outgoing string const out)

results in this validation error

IWN.VAL.4958.e 44/30 The const modifier is not allowed to be specified with the out modifier.

However this doesn't give me any validation error

    function called(incoming string const inout)

Seems like a valid restriction to added since it is along the line of these two languages changes: 
Literals are no longer allowed to be passed to INOUT function parms. 
Constants are no longer allowed to be passed to INOUT function parameters.

Otherwise, both generators have issues.
Comment 1 Kathy Carroll CLA 2011-11-11 08:26:27 EST
Created attachment 206840 [details]
eunit library
Comment 2 Kathy Carroll CLA 2011-11-14 13:42:29 EST
Paul,
 
I was wrong.  Both generators are OK with CONST INOUT parameter specification.  The issue I see is with +=.  I tried this code in RBD and got this validation message:

IWN.VAL.6646.e 28/6 driver - Invalid attempt to modify incoming which is a constant. Constants are not allowed to be modified. 

EDT doesn't give me an error.

    function testForPaul(){@Test}
    	outgoing string = "before";
    	called(outgoing);
    	LogResult.assertStringEqual1("before", outgoing);
    end

    function called(incoming string const inout)
    	action string = incoming + " more stuff";
 	incoming += " after";
    end
Comment 3 Paul Harmon CLA 2011-11-15 12:35:18 EST
I have fixed the validation so that it will now give an error when using the += assignment with Const strings.


Change was made to AssignmentStatementValidator
Comment 4 Kathy Carroll CLA 2011-11-16 12:51:09 EST
verified 20111115_2101 and closed