@@ -47,20 +47,19 @@ object Matcher {
47
47
if (scrutinees.size != patterns.size) None
48
48
else foldMatchings(scrutinees.zip(patterns).map(treeMatches): _* )
49
49
50
- (scrutinee, pattern) match {
51
- // Normalize blocks without statements
52
- case (Block (Nil , expr), _) => treeMatches(expr, pattern)
53
- case (_, Block (Nil , pat)) => treeMatches(scrutinee, pat)
50
+ def normalize (tree : Tree ): Tree = tree match {
51
+ case Block (Nil , expr) => normalize(expr)
52
+ case Inlined (_, Nil , expr) => normalize(expr)
53
+ case _ => tree
54
+ }
55
+
56
+ (normalize(scrutinee), normalize(pattern)) match {
54
57
55
58
// Match a scala.internal.Quoted.patternHole and return the scrutinee tree
56
59
case (IsTerm (scrutinee), TypeApply (patternHole, tpt :: Nil ))
57
60
if patternHole.symbol == kernel.Definitions_InternalQuoted_patternHole && scrutinee.tpe <:< tpt.tpe =>
58
61
Some (Tuple1 (scrutinee.seal))
59
62
60
- // Normalize inline trees
61
- case (Inlined (_, Nil , scr), _) => treeMatches(scr, pattern)
62
- case (_, Inlined (_, Nil , pat)) => treeMatches(scrutinee, pat)
63
-
64
63
//
65
64
// Match two equivalent trees
66
65
//
0 commit comments