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 a problem where parens are removed after a yield #2118

Merged
merged 1 commit into from
Jul 24, 2020

Conversation

daddykotex
Copy link
Contributor

it's a problem when there is no space between the yield and the
parens because it leaves the code in a broken state (won't compile)

Fixes #2117

it's a problem when there is no space between the yield and the
parens because it leaves the code in a broken state (won't compile)

Fixes scalameta#2117
Copy link
Collaborator

@poslegm poslegm left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@poslegm poslegm merged commit a068810 into scalameta:master Jul 24, 2020
object a {
val x = for {
a <- b
} yield(a)
Copy link
Collaborator

Choose a reason for hiding this comment

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

is this specific to yield? what about:

  a match {
    case a if(a) => a
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm testing it as we speak, I'll open another MR if it also fails there

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh I just saw you PR, great. I was not sure if extra spaces would be removed later on

Copy link
Collaborator

Choose a reason for hiding this comment

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

i already fixed it, see linked pr.

Copy link
Collaborator

Choose a reason for hiding this comment

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

and thank you for not only reporting a problem but also fixing it. doesn't happen too often :)

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.

RedundantParens removes parens surrounding in the context of a for yield
3 participants