Skip to content

Fix position of desugared tree wrapped in parentheses #3527

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

Merged
merged 1 commit into from
Nov 23, 2017

Conversation

smarter
Copy link
Member

@smarter smarter commented Nov 22, 2017

Before this commit, the added testcase produced the following result:

scala> while ((( foo ))) {}
1 |while ((( foo ))) {}
  |      ^^^^^^^^^^^
  |      not found: foo

@smarter smarter requested a review from allanrenucci November 22, 2017 15:19
case _ =>
}

val desugared = tree match {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove the Parens case in this pattern match

@@ -64,3 +64,7 @@ scala> { def f: Int = g; val x: Int = 1; def g: Int = 5; }
1 | { def f: Int = g; val x: Int = 1; def g: Int = 5; }
| ^
| `g` is a forward reference extending over the definition of `x`
scala> while ((( foo ))) {}
1 |while ((( foo ))) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to shift the error message by one space after the |. This is a weird issue. I haven't figure it out yet

Before this commit, the added testcase produced the following result:

scala> while ((( foo ))) {}
1 |while ((( foo ))) {}
  |      ^^^^^^^^^^^
  |      not found: foo
@allanrenucci allanrenucci merged commit bf9f055 into scala:master Nov 23, 2017
@allanrenucci allanrenucci deleted the fix-parens-desugar branch November 23, 2017 14:08
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.

2 participants