@@ -38,15 +38,18 @@ object Matcher {
38
38
case (Block (Nil , expr), _) => treeMatches(expr, pattern)
39
39
case (_, Block (Nil , pat)) => treeMatches(scrutinee, pat)
40
40
41
- // Match
41
+ // Match a scala.internal.Quoted.patternHole and return the scrutinee tree
42
42
case (IsTerm (scrutinee), TypeApply (patternHole, tpt :: Nil ))
43
43
if patternHole.symbol == kernel.Definitions_InternalQuoted_patternHole && scrutinee.tpe <:< tpt.tpe =>
44
44
Some (Tuple1 (scrutinee.seal))
45
45
46
- case (Inlined (_, Nil , scr), _) =>
47
- treeMatches(scr, pattern)
48
- case (_, Inlined (_, Nil , pat)) =>
49
- treeMatches(scrutinee, pat)
46
+ // Normalize inline trees
47
+ case (Inlined (_, Nil , scr), _) => treeMatches(scr, pattern)
48
+ case (_, Inlined (_, Nil , pat)) => treeMatches(scrutinee, pat)
49
+
50
+ //
51
+ // Match two equivalent trees
52
+ //
50
53
51
54
case (Literal (constant1), Literal (constant2)) if constant1 == constant2 =>
52
55
Some (())
@@ -150,6 +153,7 @@ object Matcher {
150
153
val finalizerMatch = treeOptMatches(finalizer1, finalizer2)
151
154
foldMatchings(bodyMacth, casesMatch, finalizerMatch)
152
155
156
+ // No Match
153
157
case _ =>
154
158
if (debug)
155
159
println(
0 commit comments