rusty icon indicating copy to clipboard operation
rusty copied to clipboard

Add validation for invalid call parameter count

Open mhasel opened this issue 2 years ago • 0 comments

Is your feature request related to a problem? Please describe. Currently we are not validating the amount of passed parameters to function calls. Calls with too many/too few parameters will fail with an error during codegen. Example:

FUNCTION foo : DINT
        VAR_INPUT
            x1 : DINT;
            x2 : REAL;
        END_VAR
END_FUNCTION

FUNCTION main : DINT
        VAR
            x1 : DINT;
            x2 : REAL;
        END_VAR
            foo(x1);
            foo(x1, x2, x1, x2);
END_FUNCTION

Describe the solution you'd like We should add a validation to check for invalid param count.

mhasel avatar Nov 23 '23 14:11 mhasel