Skip to content

Commit b829b72

Browse files
committed
Cover holes in any part of the prefix
1 parent 1a210f6 commit b829b72

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,9 +244,12 @@ object QuoteMatcher {
244244
case Select(qual2, _) if symbolMatch(scrutinee, pattern) =>
245245
ref match
246246
case Select(qual1, _) => qual1 =?= qual2
247-
case ref: Ident if qual2.symbol == defn.QuotedRuntimePatterns_patternHole =>
248-
tpd.desugarIdentPrefix(ref) =?= qual2
249-
case ref: Ident => matched
247+
case ref: Ident =>
248+
if qual2.existsSubTree(_.symbol == defn.QuotedRuntimePatterns_patternHole) then
249+
// Prefix has a hole, so we need to match the prefix to extract the value of the hole
250+
tpd.desugarIdentPrefix(ref) =?= qual2
251+
else
252+
matched
250253

251254
/* Match reference */
252255
case _: Ident if symbolMatch(scrutinee, pattern) => matched

0 commit comments

Comments
 (0)