Skip to content

Fix #5997: Add missing parentheses #6182

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 2 commits into from
Mar 28, 2019
Merged

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

Copy link
Contributor

@abgruszecki abgruszecki left a comment

Choose a reason for hiding this comment

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

Hijacking, since I approve of anything that adds parentheses.

Looks mostly good to me, but I think that printQual should also be used when printing match and function application:

$ cat test.scala
class C {
  def foo(x: Boolean) = !x
  def bar() = (if true then 1 else 2) match { case x => x }
  def baz() = (if true then identity else identity)(0)
}
$ ../bin/dotc -decompile C
/** Decompiled from ./C.tasty */
class C() {
  def foo(x: scala.Boolean): scala.Boolean = x.unary_!
  def bar(): scala.Int = if (true) 1 else 2 match {
    case x =>
      (x: scala.Int)
  }
  def baz(): scala.Any = if (true) ((x: scala.Any) => scala.Predef.identity[scala.Any](x)) else ((x: scala.Any) => scala.Predef.identity[scala.Any](x)).apply(0)

@nicolasstucki nicolasstucki merged commit 1818972 into scala:master Mar 28, 2019
@ghost ghost removed the stat:needs review label Mar 28, 2019
@nicolasstucki nicolasstucki deleted the fix-#5997 branch March 28, 2019 17:11
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.

3 participants