Skip to content

Invalid optimization of case statements with constant expression #147

Description

@cardillan

The following code

def foo(n)
    case n
        when 0 then return 0;
    end;

    n + 1;
end;

print(foo(5));

print 0 instead of 6. The problem is caused by wrong optimization of the case statement with constant input value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoptimizerRelated to the code optimizer

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions