Skip to content

Undefined error when having a for-loop be unreachable code #168

@falkecarlsen

Description

@falkecarlsen

Turns out the following if-else-for.cell program does not work:

world {
    size = 100 [wrap], 200 [wrap];
    tickrate = 1;
    cellsize = 5;
}

state ident (0, 0, 0) {
    become ident;
}

function f(int a) int {
    if (a == 1) {
        return a;
    } else {
        return a;
    }

    for (let x = a; x < a; x = x+1) {
        let y = 2;
    } 
    return a;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-from-testingSomething isn't working, found during testing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions