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 {
20
20
21
21
protected var skolemsOutstanding = false
22
22
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 =>
25
25
tp
26
26
case tp : ValueType =>
27
27
skolemsOutstanding = true
28
28
SkolemType (tp)
29
29
case tp : TypeProxy =>
30
- ensureSingleton (tp.underlying)
30
+ ensureStableSingleton (tp.underlying)
31
31
}
32
32
33
33
/** Approximate a type `tp` with a type that does not contain skolem types.
Original file line number Diff line number Diff line change @@ -527,7 +527,7 @@ class TypeComparer(initctx: Context) extends DotClass with ConstraintHandling wi
527
527
val saved = skolemsOutstanding
528
528
try {
529
529
val rebindNeeded = tp2.refinementRefersToThis
530
- val base = if (rebindNeeded) ensureSingleton (tp1) else tp1
530
+ val base = if (rebindNeeded) ensureStableSingleton (tp1) else tp1
531
531
val rinfo2 = if (rebindNeeded) tp2.refinedInfo.substSkolem(tp2, base) else tp2.refinedInfo
532
532
def qualifies (m : SingleDenotation ) = isSubType(m.info, rinfo2)
533
533
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.
3
1
abstract class A { type T }
4
2
5
3
abstract class B { val xz : Any }
@@ -11,6 +9,6 @@ abstract class Test {
11
9
}
12
10
13
11
abstract 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 ;
15
13
val xx : A with B { type T ; val xz : T } = yy
16
14
}
You can’t perform that action at this time.
0 commit comments