File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed
src/dotty/tools/dotc/core Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -20,14 +20,14 @@ trait Skolemization {
2020
2121 protected var skolemsOutstanding = false
2222
23- def ensureSingleton (tp : Type ): SingletonType = tp.stripTypeVar match {
24- case tp : SingletonType =>
23+ def ensureStableSingleton (tp : Type ): SingletonType = tp.stripTypeVar match {
24+ case tp : SingletonType if tp.isStable =>
2525 tp
2626 case tp : ValueType =>
2727 skolemsOutstanding = true
2828 SkolemType (tp)
2929 case tp : TypeProxy =>
30- ensureSingleton (tp.underlying)
30+ ensureStableSingleton (tp.underlying)
3131 }
3232
3333 /** Approximate a type `tp` with a type that does not contain skolem types.
Original file line number Diff line number Diff line change @@ -517,7 +517,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling wi
517517 val saved = skolemsOutstanding
518518 try {
519519 val rebindNeeded = tp2.refinementRefersToThis
520- val base = if (rebindNeeded) ensureSingleton (tp1) else tp1
520+ val base = if (rebindNeeded) ensureStableSingleton (tp1) else tp1
521521 val rinfo2 = if (rebindNeeded) tp2.refinedInfo.substSkolem(tp2, base) else tp2.refinedInfo
522522 def qualifies (m : SingleDenotation ) = isSubType(m.info, rinfo2)
523523 def memberMatches (mbr : Denotation ): Boolean = mbr match { // inlined hasAltWith for performance
Original file line number Diff line number Diff line change 1- // There's still a problem with var's here, presumably because they are not paths.
2- // Needs some more investigation.
31abstract class A { type T }
42
53abstract class B { val xz : Any }
@@ -11,6 +9,6 @@ abstract class Test {
119}
1210
1311abstract class Test2 {
14- val yy : A with B { type T ; val xz : T } = null ;
12+ var yy : A with B { type T ; val xz : T } = null ;
1513 val xx : A with B { type T ; val xz : T } = yy
1614}
You can’t perform that action at this time.
0 commit comments