Skip to content

ELSIF conditional regression #1400

Open
@mhasel

Description

@mhasel

#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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionThis used to work, but no longer does

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions