Skip to content

[EOL] Parser crashes if there is a missing semicolon inside an else block inside a loop #191

@Arkaedan

Description

@Arkaedan
while (false) {
    if (true) {
        "hello".println();
    } else {
        "world".println()
    }
}

or

for (num in Set {1,2}) {
    if (true) {
        "hello".println();
    } else {
        "world".println()
    }
}

Both of these cause the parser to crash with the following exception:

java.lang.IllegalArgumentException: null was expected to be a StatementBlock, Statement or Expression but instead it is null

A normal parse problem is reported (correct behaviour) in the following situations:

if (false) {
    if (true) {
        "hello".println();
    } else {
        "world".println()
    }
}
// or
while (false) {
    if (true) {
        "hello".println()
    } else {
        "world".println();
    }
}
// or
if (true) {
    "hello".println();
} else {
    "world".println()
}

Metadata

Metadata

Assignees

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