-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
REPL multi-row input does not handle correctly catch #4393
Labels
Milestone
Comments
To fix this, one would need to change the parser to emit an |
I have a fix, but do we have tests for these things? |
Blaisorblade
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 24, 2018
Min tests: `try { ??? } catch {}` (can be scripted) and `try { ??? } catch {`.
Blaisorblade
added a commit
to dotty-staging/dotty
that referenced
this issue
Jul 25, 2018
Min tests: `try { ??? } catch {}` (can be scripted) and `try { ??? } catch {`.
@Blaisorblade I don't think we have. It should be fairly easy to create parser unit tests though: def myTest = {
val source = new SourceFile("<test>", "try ... catch ...")
val reporter = new StoreReporter(null)
implicit val ctx = ...
val incompleteHandle: MessageContainer => Context => Unit = ...
reporter.withIncompleteHandler(incompleteHandle) {
val parser = new Parser(source)
parser.expr()
}
} |
OlivierBlanvillain
pushed a commit
to dotty-staging/dotty
that referenced
this issue
Mar 19, 2019
Min tests: `try { ??? } catch {}` (can be scripted) and `try { ??? } catch {`.
ckipp01
added a commit
to ckipp01/dotty
that referenced
this issue
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 scala> try { | ??? | } catch ``` And you hit enter you'll still be able to continue. Fixes scala#4393
ckipp01
added a commit
to ckipp01/dotty
that referenced
this issue
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 scala> try { | ??? | } catch ``` And you hit enter you'll still be able to continue. Fixes scala#4393
olsdavis
pushed a commit
to olsdavis/dotty
that referenced
this issue
Apr 4, 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 scala> try { | ??? | } catch ``` And you hit enter you'll still be able to continue. Fixes scala#4393
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: