Skip to content

Add validation for invalid call parameter count #1027

Closed
@mhasel

Description

@mhasel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions