File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1954,6 +1954,7 @@ 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
19581959 tp1.member(name) match // inlined hasAltWith for performance
19591960 case mbr : SingleDenotation => qualifies(mbr)
Original file line number Diff line number Diff line change 1+ class A :
2+ val x : AnyRef = Object ()
3+ val y : AnyRef = Object ()
4+
5+ @ main def m : Unit =
6+ val a = new A
7+ val b : a.x.type = a.x
8+ val c : A { val x : a.x.type } = a
9+ val d : A { val x : a.x.type ; val y : a.y.type } = a
You can’t perform that action at this time.
0 commit comments