Skip to content

Commit 935ac94

Browse files
committed
Move refined singleton check in qualifies
1 parent 1eee2e0 commit 935ac94

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,12 +1954,11 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
19541954
val info1 = m.info.widenExpr
19551955
isSubInfo(info1, tp2.refinedInfo.widenExpr, m.symbol.info.orElse(info1))
19561956
|| matchAbstractTypeMember(m.info)
1957+
|| (tp1.isStable && isSubType(TermRef(tp1, m.symbol), tp2.refinedInfo))
19571958

1958-
def memberQualifies = tp1.member(name) match // inlined hasAltWith for performance
1959+
tp1.member(name) match // inlined hasAltWith for performance
19591960
case mbr: SingleDenotation => qualifies(mbr)
19601961
case mbr => mbr hasAltWith qualifies
1961-
1962-
memberQualifies || (tp1.isStable && isSub(TermRef(tp1, name), tp2.refinedInfo))
19631962
}
19641963

19651964
final def ensureStableSingleton(tp: Type): SingletonType = tp.stripTypeVar match {

0 commit comments

Comments
 (0)