Skip to content

Commit 7f2771e

Browse files
committed
Improve getCapturedIdent to capture more patterns of eta-expansion
1 parent 5e45209 commit 7f2771e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ object QuoteMatcher {
217217
* This function restores the symbol of the original method from
218218
* the eta-expanded function.
219219
*/
220-
def getCapturedIdent(arg: Tree)(using Context): Ident =
220+
def getCapturedIdent(arg: LazyTree)(using Context): Ident =
221221
arg match
222222
case id: Ident => id
223-
case Block(DefDef(_, _, _, Apply(id: Ident, _))::_, _) => id
224-
case Apply(id: Ident, _) => id
223+
case Apply(term, _) => getCapturedIdent(term)
224+
case Block(DefDef(_, _, _, term)::_, _) => getCapturedIdent(term)
225225
case y => ???
226226

227227
val env = summon[Env]

0 commit comments

Comments
 (0)