Skip to content

Commit 7015c7f

Browse files
committed
Use new extension syntax in Matcher
1 parent 480f95f commit 7015c7f

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -478,17 +478,19 @@ object Matcher {
478478
val matched: Matching = Some(Tuple())
479479
def matched(x: Any): Matching = Some(Tuple1(x))
480480

481-
def (self: Matching) asOptionOfTuple: Option[Tuple] = self
482-
483-
/** Concatenates the contents of two successful matchings or return a `notMatched` */
484-
def (self: Matching) &&& (that: => Matching): Matching = self match {
485-
case Some(x) =>
486-
that match {
487-
case Some(y) => Some(x ++ y)
488-
case _ => None
489-
}
490-
case _ => None
491-
}
481+
extension (self: Matching):
482+
def asOptionOfTuple: Option[Tuple] = self
483+
484+
/** Concatenates the contents of two successful matchings or return a `notMatched` */
485+
def &&& (that: => Matching): Matching = self match {
486+
case Some(x) =>
487+
that match {
488+
case Some(y) => Some(x ++ y)
489+
case _ => None
490+
}
491+
case _ => None
492+
}
493+
end extension
492494

493495
}
494496

0 commit comments

Comments
 (0)