Skip to content

Typestate apparently doesn't handle loops... #819

Closed
@eholk

Description

@eholk
fn test00_start(ch: _chan[int], message: int, count: int) {
    log "Starting test00_start";
    let i: int = 0;
    while i < count {
        log "Sending Message";
        send(ch, message);
        i = i + 1;
    }
    log "Ending test00_start";
}

send uses move-mode for the second argument, which means that message is deinitialized the second time through the loop. Typestate should catch this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions