Skip to content

Commit 68ddd08

Browse files
committed
Pass type args to matchedOpen
1 parent 4dcfb7f commit 68ddd08

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
@@ -320,11 +320,11 @@ class QuoteMatcher(debug: Boolean) {
320320
val env = summon[Env]
321321
val capturedIds = args.map(getCapturedIdent)
322322
val capturedSymbols = capturedIds.map(_.symbol)
323-
val captureEnv = env.filter((k, v) => !capturedSymbols.contains(v))
324-
val unrolledTargs = unrollHkNestedPairsTypeTree(targs)
323+
val capturedTargs = unrollHkNestedPairsTypeTree(targs)
324+
val captureEnv = env.filter((k, v) => !capturedSymbols.contains(v) && !capturedTargs.map(_.symbol).contains(v))
325325
withEnv(captureEnv) {
326326
scrutinee match
327-
case ClosedPatternTerm(scrutinee) => matchedOpen(scrutinee, pattern.tpe, capturedIds, args.map(_.tpe), unrolledTargs.map(_.tpe), env)
327+
case ClosedPatternTerm(scrutinee) => matchedOpen(scrutinee, pattern.tpe, capturedIds, args.map(_.tpe), capturedTargs.map(_.tpe), env)
328328
case _ => notMatched
329329
}
330330

0 commit comments

Comments
 (0)