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

Reformat causes parse error when using semicolon in try #3492

Closed
adamw opened this issue Mar 7, 2023 · 0 comments · Fixed by #3501
Closed

Reformat causes parse error when using semicolon in try #3492

adamw opened this issue Mar 7, 2023 · 0 comments · Fixed by #3501

Comments

@adamw
Copy link

adamw commented Mar 7, 2023

The following code formats fine:

object Test:
  def test =
    try
      1
      2
    catch
      case _: RuntimeException => 2
      case _: Exception        => 3

But if I change it to:

object Test:
  def test =
    try
      1; 2
    catch
      case _: RuntimeException => 2
      case _: Exception        => 3

This is reformatted as:

object Test:
  def test =
    try 1; 2
    catch
      case _: RuntimeException => 2
      case _: Exception        => 3

Which then causes a parse error in scalafmt.

My scalafmt conf file:

version = 3.7.2
maxColumn = 140
runner.dialect = scala3
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 a pull request may close this issue.

1 participant