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

Brace-less syntax for try/catch/finally gets confused by parentheses #5887

Closed
scabug opened this issue Jun 6, 2012 · 2 comments · Fixed by scala/scala#8071
Closed

Brace-less syntax for try/catch/finally gets confused by parentheses #5887

scabug opened this issue Jun 6, 2012 · 2 comments · Fixed by scala/scala#8071
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Jun 6, 2012

The parser accepts expressions without braces after "try" but when an open paren occurs, it fails to parse it as part of the expressions and expects the whole expression to be enclosed in parens:

scala> try 1 + 1 finally ()
res0: Int = 2

scala> try (1) + 1 finally ()
<console>:1: error: ';' expected but identifier found.
       try (1) + 1 finally ()
               ^
@scabug
Copy link
Author

scabug commented Jun 6, 2012

Imported From: https://issues.scala-lang.org/browse/SI-5887?orig=1
Reporter: @szeiger
Affected Versions: 2.10.0-M3, 2.10.0

@scabug
Copy link
Author

scabug commented Feb 15, 2015

@som-snytt said:
scala/scala#4334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants