Skip to content

do-while with continue will cause infinite loop during running #2030

Closed
@HerrCai0907

Description

@HerrCai0907

this code will go to a infinite loop. becase continue jump to the beginning of do-while. However, maybe it is more reasonable to jump to line }while(i<10)?

export function test(): void {
    let i = 0;
    do {
        i++
        continue
    } while (i < 10)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions