Skip to content

Commit 2b6824f

Browse files
committed
Use new extension syntax in Matcher
1 parent 7ff4ab0 commit 2b6824f

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

library/src/scala/internal/quoted/Matcher.scala

+5-7
Original file line numberDiff line numberDiff line change
@@ -206,14 +206,12 @@ object Matcher {
206206
case _ => notMatched
207207
}
208208

209-
private extension treeListOps on (scrutinees: List[Tree]) {
209+
extension (scrutinees: List[Tree]):
210210
/** Check that all trees match with =?= and concatenate the results with &&& */
211-
def =?= (patterns: List[Tree])(using Context, Env): Matching =
211+
private def =?= (patterns: List[Tree])(using Context, Env): Matching =
212212
matchLists(scrutinees, patterns)(_ =?= _)
213-
}
214-
215-
private extension treeOps on (scrutinee0: Tree) {
216213

214+
extension (scrutinee0: Tree):
217215
/** Check that the trees match and return the contents from the pattern holes.
218216
* Return None if the trees do not match otherwise return Some of a tuple containing all the contents in the holes.
219217
*
@@ -222,7 +220,7 @@ object Matcher {
222220
* @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`.
223221
* @return `None` if it did not match or `Some(tup: Tuple)` if it matched where `tup` contains the contents of the holes.
224222
*/
225-
def =?= (pattern0: Tree)(using Context, Env): Matching = {
223+
private def =?= (pattern0: Tree)(using Context, Env): Matching = {
226224

227225
/* Match block flattening */ // TODO move to cases
228226
/** Normalize the tree */
@@ -426,7 +424,7 @@ object Matcher {
426424
notMatched
427425
}
428426
}
429-
}
427+
end extension
430428

431429
private object ClosedPatternTerm {
432430
/** Matches a term that does not contain free variables defined in the pattern (i.e. not defined in `Env`) */

0 commit comments

Comments
 (0)