Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363579 - CONST parameter modifier shouldn't be allowed with the inOut modifier
Summary: CONST parameter modifier shouldn't be allowed with the inOut modifier
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-11-11 07:49 EST by Kathy Carroll CLA
Modified: 2017-02-23 14:16 EST (History)
1 user (show)

See Also:


Attachments
eunit library (1.93 KB, application/octet-stream)
2011-11-11 08:26 EST, Kathy Carroll CLA
no flags Details

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