Skip to content

Commit 1a210f6

Browse files
committed
Simplify quote pattern Ident prefix logic
1 parent 250533c commit 1a210f6

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,10 @@ object QuoteMatcher {
244244
case Select(qual2, _) if symbolMatch(scrutinee, pattern) =>
245245
ref match
246246
case Select(qual1, _) => qual1 =?= qual2
247-
case ref: Ident =>
248-
ref.tpe match
249-
case TermRef(qual: TermRef, _) => tpd.ref(qual) =?= qual2
250-
case TermRef(qual: ThisType, _) if qual.classSymbol.is(Module, butNot = Package) =>
251-
tpd.ref(qual.classSymbol.companionModule) =?= qual2
252-
case TermRef(qual, _) if qual.typeSymbol.isClass && qual2.symbol == defn.QuotedRuntimePatterns_patternHole =>
253-
tpd.desugarIdentPrefix(ref) =?= qual2
254-
case _ => matched
247+
case ref: Ident if qual2.symbol == defn.QuotedRuntimePatterns_patternHole =>
248+
tpd.desugarIdentPrefix(ref) =?= qual2
249+
case ref: Ident => matched
250+
255251
/* Match reference */
256252
case _: Ident if symbolMatch(scrutinee, pattern) => matched
257253
/* Match type */

0 commit comments

Comments
 (0)