Skip to content

Commit 8b014cc

Browse files
committed
Fix logic to extract rhd of DefDef
1 parent 38cf5c3 commit 8b014cc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,19 +209,23 @@ object QuoteMatcher {
209209

210210
/* Some of method symbols in arguments of higher-order term hole are eta-expanded.
211211
* e.g.
212-
* g: Int -> Int
212+
* g: (Int) => Int
213213
* => {
214214
* def $anonfun(y: Int): Int = g(y)
215215
* closure($anonfun)
216216
* }
217+
*
218+
* f: (using Int) => Int
219+
* => f(using x)
217220
* This function restores the symbol of the original method from
218221
* the eta-expanded function.
219222
*/
220-
def getCapturedIdent(arg: LazyTree)(using Context): Ident =
223+
def getCapturedIdent(arg: Tree)(using Context): Ident =
221224
arg match
222225
case id: Ident => id
223226
case Apply(term, _) => getCapturedIdent(term)
224-
case Block(DefDef(_, _, _, term)::_, _) => getCapturedIdent(term)
227+
case Block((ddef: DefDef) :: _, _) => getCapturedIdent(ddef.rhs)
228+
// How should I deal with it?
225229
case y => ???
226230

227231
val env = summon[Env]

0 commit comments

Comments
 (0)