Skip to content
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

fix(parser): make empty catch an incomplete. #14519

Merged
merged 1 commit into from Feb 21, 2022

Conversation

ckipp01
Copy link
Member

@ckipp01 ckipp01 commented Feb 19, 2022

When parsing a TRY if there is an empty catch block instead of just
returning a syntax error return an incomplete if you're at the EOF. This
ensures that in the REPL if you are in a position like:

scala> try {
     | ???
     | } catch

And you hit enter you'll still be able to continue.

Fixes #4393

@som-snytt
Copy link
Contributor

Thanks, I was able to close my ticket as a duplicate, as my ticket number is 10,000 higher.

When parsing a `TRY` if there is an empty catch block instead of just
returning a syntax error return an incomplete if you're at the EOF. This
ensures that in the REPL if you are in a position like:

```scala
scala> try {
     | ???
     | } catch
```

And you hit enter you'll still be able to continue.

Fixes scala#4393
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@odersky odersky merged commit cf9525c into scala:main Feb 21, 2022
@ckipp01 ckipp01 deleted the incompleteCatch branch February 21, 2022 15:44
@Kordyjan Kordyjan added this to the 3.1.3 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REPL multi-row input does not handle correctly catch
4 participants