Skip to content

Commit 4d8f7f3

Browse files
committed
Use implied for in Matcher
1 parent 9ef6418 commit 4d8f7f3

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

library/src-3.x/scala/internal/quoted/Matcher.scala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,13 @@ object Matcher {
239239

240240
def caseMatches(scrutinee: CaseDef, pattern: CaseDef) given Env: Option[Tuple] = {
241241
val (caseEnv, patternMatch) = patternMatches(scrutinee.pattern, pattern.pattern)
242-
val guardMatch = treeOptMatches(scrutinee.guard, pattern.guard) given caseEnv
243-
val rhsMatch = treeMatches(scrutinee.rhs, pattern.rhs) given caseEnv
244-
foldMatchings(patternMatch, guardMatch, rhsMatch)
242+
243+
{
244+
implied for Env = caseEnv
245+
val guardMatch = treeOptMatches(scrutinee.guard, pattern.guard)
246+
val rhsMatch = treeMatches(scrutinee.rhs, pattern.rhs)
247+
foldMatchings(patternMatch, guardMatch, rhsMatch)
248+
}
245249
}
246250

247251
/** Check that the pattern trees match and return the contents from the pattern holes.
@@ -312,7 +316,8 @@ object Matcher {
312316
}
313317
}
314318

315-
(treeMatches(scrutineeExpr.unseal, patternExpr.unseal) given Set.empty).asInstanceOf[Option[Tup]]
319+
implied for Env = Set.empty
320+
treeMatches(scrutineeExpr.unseal, patternExpr.unseal).asInstanceOf[Option[Tup]]
316321
}
317322

318323
/** Joins the mattchings into a single matching. If any matching is `None` the result is `None`.

0 commit comments

Comments
 (0)