#1379 has resulted in a regression when evaluating ELSIF conditions if said condition contains a call to a function with aggregate return types. Due to the way the AST is lowered, these calls will now always be evaluated even if any of the previous conditional blocks already evaluated as TRUE, possibly leading to side-effects.
A possible solution to this is further lowering IF conditional blocks and nesting each ELSIF statement in a separate IF THEN ELSE statement within the previous conditions ELSE block, i.e.
IF condition THEN
// ...
ELSIF condition2 THEN
// ...
END_IF
should turn into
IF condition THEN
// ...
ELSE
IF condition2 THEN
// ...
ELSE
// ...
END_IF
END_IF
#1379 has resulted in a regression when evaluating
ELSIFconditions if said condition contains a call to a function with aggregate return types. Due to the way the AST is lowered, these calls will now always be evaluated even if any of the previous conditional blocks already evaluated asTRUE, possibly leading to side-effects.A possible solution to this is further lowering
IFconditional blocks and nesting eachELSIFstatement in a separateIF THEN ELSEstatement within the previous conditionsELSEblock, i.e.should turn into