@@ -137,7 +137,7 @@ object Matcher {
137
137
138
138
extension (scrutinees : List [Tree ]):
139
139
/** Check that all trees match with =?= and concatenate the results with &&& */
140
- private def =?= (patterns : List [Tree ])(using Context , Env ): Matching =
140
+ private def =?= (patterns : List [Tree ])(using Env ): Matching =
141
141
matchLists(scrutinees, patterns)(_ =?= _)
142
142
143
143
extension (scrutinee0 : Tree ):
@@ -149,7 +149,7 @@ object Matcher {
149
149
* @param `summon[Env]` Set of tuples containing pairs of symbols (s, p) where s defines a symbol in `scrutinee` which corresponds to symbol p in `pattern`.
150
150
* @return `None` if it did not match or `Some(tup: Tuple)` if it matched where `tup` contains the contents of the holes.
151
151
*/
152
- private def =?= (pattern0 : Tree )(using Context , Env ): Matching = {
152
+ private def =?= (pattern0 : Tree )(using Env ): Matching = {
153
153
154
154
/* Match block flattening */ // TODO move to cases
155
155
/** Normalize the tree */
@@ -299,7 +299,7 @@ object Matcher {
299
299
/* Match val */
300
300
case (ValDef (_, tpt1, rhs1), ValDef (_, tpt2, rhs2)) if checkValFlags() =>
301
301
def rhsEnv = summon[Env ] + (scrutinee.symbol -> pattern.symbol)
302
- tpt1 =?= tpt2 &&& treeOptMatches(rhs1, rhs2)(using summon[ Context ], rhsEnv)
302
+ tpt1 =?= tpt2 &&& treeOptMatches(rhs1, rhs2)(using rhsEnv)
303
303
304
304
/* Match def */
305
305
case (DefDef (_, typeParams1, paramss1, tpt1, Some (rhs1)), DefDef (_, typeParams2, paramss2, tpt2, Some (rhs2))) =>
@@ -348,11 +348,11 @@ object Matcher {
348
348
349
349
private object ClosedPatternTerm {
350
350
/** Matches a term that does not contain free variables defined in the pattern (i.e. not defined in `Env`) */
351
- def unapply (term : Term )(using Context , Env ): Option [term.type ] =
351
+ def unapply (term : Term )(using Env ): Option [term.type ] =
352
352
if freePatternVars(term).isEmpty then Some (term) else None
353
353
354
354
/** Return all free variables of the term defined in the pattern (i.e. defined in `Env`) */
355
- def freePatternVars (term : Term )(using ctx : Context , env : Env ): Set [Symbol ] =
355
+ def freePatternVars (term : Term )(using env : Env ): Set [Symbol ] =
356
356
val accumulator = new TreeAccumulator [Set [Symbol ]] {
357
357
def foldTree (x : Set [Symbol ], tree : Tree )(owner : Symbol ): Set [Symbol ] =
358
358
tree match
@@ -363,7 +363,7 @@ object Matcher {
363
363
}
364
364
365
365
private object IdentArgs {
366
- def unapply (args : List [Term ])( using Context ) : Option [List [Ident ]] =
366
+ def unapply (args : List [Term ]): Option [List [Ident ]] =
367
367
args.foldRight(Option (List .empty[Ident ])) {
368
368
case (id : Ident , Some (acc)) => Some (id :: acc)
369
369
case (Block (List (DefDef (" $anonfun" , Nil , List (params), Inferred (), Some (Apply (id : Ident , args)))), Closure (Ident (" $anonfun" ), None )), Some (acc))
@@ -373,7 +373,7 @@ object Matcher {
373
373
}
374
374
}
375
375
376
- private def treeOptMatches (scrutinee : Option [Tree ], pattern : Option [Tree ])(using Context , Env ): Matching = {
376
+ private def treeOptMatches (scrutinee : Option [Tree ], pattern : Option [Tree ])(using Env ): Matching = {
377
377
(scrutinee, pattern) match {
378
378
case (Some (x), Some (y)) => x =?= y
379
379
case (None , None ) => matched
0 commit comments