Skip to content

Commit 3652eca

Browse files
committed
Simplify adaptMethodCall
1 parent 544818d commit 3652eca

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,12 +517,7 @@ object QuoteMatcher {
517517
* f has a method type `(x: Int): Int` and `f` maps to `g`, `p` should hold
518518
* `g.apply(0)` because the type of `g` is `Int => Int` due to eta expansion.
519519
*/
520-
case Apply(_, _) if !tree.tpe.isInstanceOf[MethodicType] && env.contains(tree.symbol) =>
521-
def adaptMethodCalls(t: Tree): Tree = t match
522-
case id: Ident => env.get(id.symbol).flatMap(argsMap.get).getOrElse(t)
523-
case Apply(fun, args) => adaptMethodCalls(fun).select(nme.apply).appliedToArgs(args)
524-
525-
adaptMethodCalls(tree)
520+
case Apply(fun, args) if env.contains(tree.symbol) => transform(fun).select(nme.apply).appliedToArgs(args)
526521
case tree: Ident => env.get(tree.symbol).flatMap(argsMap.get).getOrElse(tree)
527522
case tree => super.transform(tree)
528523
}.transform(tree)

0 commit comments

Comments
 (0)