Skip to content

Commit c5e4942

Browse files
committed
Drop redundant isContextualMethod comparisons
isImplicitMethod is implied by isContextualMethod, no need to test the two separately.
1 parent ca36ff2 commit c5e4942

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/src/dotty/tools/dotc/core/Denotations.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ object Denotations {
540540
tp2 match
541541
case tp2: MethodType
542542
if ctx.typeComparer.matchingMethodParams(tp1, tp2)
543-
&& (tp1.isImplicitMethod || tp1.isContextualMethod) == (tp2.isImplicitMethod || tp2.isContextualMethod)
543+
&& tp1.isImplicitMethod == tp2.isImplicitMethod
544544
&& tp1.isErasedMethod == tp2.isErasedMethod =>
545545
val resType = infoMeet(tp1.resType, tp2.resType.subst(tp2, tp1), safeIntersection)
546546
if resType.exists then

compiler/src/dotty/tools/dotc/transform/PatternMatcher.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ object PatternMatcher {
380380
else {
381381
def applyImplicits(acc: Tree, implicits: List[Tree], mt: Type): Tree = mt match {
382382
case mt: MethodType =>
383-
assert(mt.isImplicitMethod || mt.isContextualMethod)
383+
assert(mt.isImplicitMethod)
384384
val (args, rest) = implicits.splitAt(mt.paramNames.size)
385385
applyImplicits(acc.appliedToArgs(args), rest, mt.resultType)
386386
case _ =>

0 commit comments

Comments
 (0)