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

Bug 363608

Summary: No validation message using as number inline for an OUT modified parameter
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:

Description Kathy Carroll CLA 2011-11-11 13:33:12 EST
Given this

Only expressions that are valid on the left hand side of an assignment statement are valid to be passed to an INOUT or OUT function parameter. Some of the things that RBD allows to be passed to an INOUT parm, for instance are: AS expressions, New expressions,  unary expressions (such as -myInt). Valid expressions are things like simple name, qualified name, array access and dynamic access.

I would expect a validation error for this code:

    function testFunctionParameterOutWithUpdateNum005() {@Test}
    	details = "Cannot instantiate the type ENumber";
    	localDec decimal(5,2) = 333.33;
    	updated decimal(5,2) = 543.21;
	updateOutParameterNum005(localDec as number);
	LogResult.assertTrue1( localDec == updated);

    end	    
    
    function updateOutParameterNum005(localLen number out)
    	localLen = 543.21;
    end
Comment 1 Paul Harmon CLA 2011-11-14 10:02:02 EST
For some reason, some old logic in FunctionArgumentValidator was short circuiting the valiation checks if the parm and argument were  both reference types.

I have removed this old (bogus) logic and now the validation behaves correctly.
Comment 2 Kathy Carroll CLA 2011-11-15 07:33:55 EST
verfied with 20111114_2101 and closed