Skip to content

Commit

Permalink
Scalameta: upgrade to v4.5.9
Browse files Browse the repository at this point in the history
Fixes parsing of additional anonymous functions.
  • Loading branch information
kitbellew committed Jun 1, 2022
1 parent 2f2e1ab commit 5ad937a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

object Dependencies {
val metaconfigV = "0.10.0"
val scalametaV = "4.5.8"
val scalametaV = "4.5.9"
val scalacheckV = "1.15.4"
val coursier = "1.0.3"
val munitV = "0.7.29"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package org.scalafmt.rewrite

import scala.annotation.tailrec
import scala.meta._
import scala.meta.internal.trees.PlaceholderChecks
import scala.meta.internal.trees.PlaceholderChecks.hasPlaceholder

import org.scalafmt.config.FilterMatcher
import org.scalafmt.config.RewriteSettings
Expand Down Expand Up @@ -103,12 +103,10 @@ class AvoidInfix(implicit ctx: RewriteCtx) extends RewriteSession {
val op = ai.op.value
InfixApp.isLeftAssoc(op) && matcher.matches(op) && (ai.args match {
case arg :: Nil if !isWrapped(arg) =>
!ctx.style.rewrite.allowInfixPlaceholderArg &&
PlaceholderChecks.isPlaceholder(arg) ||
!PlaceholderChecks.hasPlaceholder(arg)
!hasPlaceholder(arg, ctx.style.rewrite.allowInfixPlaceholderArg)
case _ => true
}) && (ai.lhs match {
case lhs: Term.ApplyInfix if PlaceholderChecks.hasPlaceholder(lhs) =>
case lhs: Term.ApplyInfix if hasPlaceholder(lhs, true) =>
isWrapped(lhs) || checkMatchingInfix(lhs)
case _ => true
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1297,5 +1297,5 @@ object a {
}
>>>
object a {
Box.apply(_: Int, _: String).tupled
(Box.apply(_: Int, _: String)).tupled
}

0 comments on commit 5ad937a

Please sign in to comment.