Skip to content

parsing of braceless for-comprehensions: unify error message for unintended code in various edge cases #11622

Closed
@unkarjedy

Description

@unkarjedy

Compiler version

3.0.0-RC1

Minimized code

@main
def Main23() = {
    for x <- 0 to 1;
    x <- 0 to 1;
    do println(1)
  
    for 
        x <- 0 to 1
    y <- 0 to 1
    do println(2)
    
    for 
    x <- 0 to 1
  y <- 0 to 1
    do println(3)
}

Output

Note that compilation error "yield or do expected" is only shown for the 2nd for and not for the 1st and 3rd

Expectation

An error should be reported in all 3 cases or in none

image

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