Skip to content

End marker allowed in weired positions #8731

Closed
@SrTobi

Description

@SrTobi

Dotty version = 0.24.0-bin-20200412-bd1fff2-NIGHTLY

Minimized code

The following code examples are all allowed even though I don't think they should be.

3 match
case 3 => ???
end match
case _ => ()
end match
if 3 == 3
  ()
end if
else
  ()
end if
class Test {
  val test = 3
end Test
}
while
  3 == 3
end while
do ()
for
  a <- Seq()
end for
do ()

Expectation

It seems that there should be a check that enforces end markers are really at the end and not in between as well as in template blocks

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions