Skip to content

Commit

Permalink
RedundantParens: keep w/ dotless select in infix
Browse files Browse the repository at this point in the history
  • Loading branch information
kitbellew committed Oct 2, 2024
1 parent 57b6d9a commit feee099
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ class RedundantParens(implicit val ftoks: FormatTokens)
case _: Lit | _: Name | _: Term.Interpolate => true
case _: Term.PartialFunction => true
case _: Term.AnonymousFunction => false
case t: Term.Select if !isSelectWithDot(t) => false
case _ => style.rewrite.redundantParens.infixSide.isDefined
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1676,8 +1676,5 @@ rewrite.redundantParens.infixSide = all
===
def newLine: Parser[String] = namedError(("\r" ?) ~> "\n", "End of line expected")
>>>
test does not parse: [dialect scala213] `)` expected but `string constant` found
def newLine: Parser[String] = namedError("\r" ? ~> "\n", "End of line expected")
^
====== full result: ======
def newLine: Parser[String] = namedError("\r" ? ~> "\n", "End of line expected")
def newLine: Parser[String] =
namedError(("\r" ?) ~> "\n", "End of line expected")

0 comments on commit feee099

Please sign in to comment.