rusty icon indicating copy to clipboard operation
rusty copied to clipboard

ADD function with initialized values leads to panicked

Open rarris opened this issue 1 year ago • 1 comments

example

PROGRAM mainProg
VAR
X, Y, Z, Res1, Res2: REAL;
END_VAR
Z := ADD(IN1 := Res1, IN2 := Res2); //not ok, generates the error below
Z := ADD(Res1, Res2); // OK
;
END_PROGRAM

thread '' panicked at 'VOID not found', src\index.rs:1244:75 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

rarris avatar Feb 14 '24 05:02 rarris

Due to the variadic nature of ADD and MUL, formal parameter assignment might be an issue since the args are not named IN1, IN2, ... but rather are passed as an array named IN. If this functionality is required, we might have to add some code to translate the n in INn to a corresponding index.

@ghaith any thoughts on this?

mhasel avatar Feb 19 '24 15:02 mhasel