Skip to content

End marker allowed in weired positions #8731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SrTobi opened this issue Apr 16, 2020 · 0 comments
Closed

End marker allowed in weired positions #8731

SrTobi opened this issue Apr 16, 2020 · 0 comments

Comments

@SrTobi
Copy link
Contributor

SrTobi commented Apr 16, 2020

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

odersky added a commit to dotty-staging/dotty that referenced this issue Apr 19, 2020
Handle end markers in parser instead of in Scanner, adding end markers
to the context free syntax.
liufengyun added a commit that referenced this issue Apr 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants