@@ -3371,19 +3371,15 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
3371
3371
stableScrut.member(typeMemberName) match
3372
3372
case denot : SingleDenotation if denot.exists =>
3373
3373
val info = denot.info match
3374
- case TypeAlias (alias) => alias
3375
- case info => info // Notably, RealTypeBounds, which will eventually give a MatchResult.NoInstances
3376
- if info.isInstanceOf [ClassInfo ] then
3377
- /* The member is not an alias (we'll get Stuck instead of NoInstances,
3378
- * which is not ideal, but we cannot make a RealTypeBounds of ClassInfo).
3379
- */
3380
- false
3381
- else
3382
- val infoRefersToSkolem = stableScrut.isInstanceOf [SkolemType ] && stableScrut.occursIn(info)
3383
- val info1 =
3384
- if infoRefersToSkolem && ! info.isInstanceOf [TypeBounds ] then RealTypeBounds (info, info) // to trigger a MatchResult.NoInstances
3385
- else info
3386
- rec(capture, info1, variance = 0 , scrutIsWidenedAbstract)
3374
+ case TypeAlias (alias) => alias // Extract the alias
3375
+ case ClassInfo (prefix, cls, _, _, _) => prefix.select(cls) // Re-select the class from the prefix
3376
+ case info => info // Notably, RealTypeBounds, which will eventually give a MatchResult.NoInstances
3377
+ val infoRefersToSkolem = stableScrut.isInstanceOf [SkolemType ] && stableScrut.occursIn(info)
3378
+ val info1 = info match
3379
+ case info : TypeBounds => info // Will already trigger a MatchResult.NoInstances
3380
+ case _ if infoRefersToSkolem => RealTypeBounds (info, info) // Explicitly trigger a MatchResult.NoInstances
3381
+ case _ => info // We have a match
3382
+ rec(capture, info1, variance = 0 , scrutIsWidenedAbstract)
3387
3383
case _ =>
3388
3384
false
3389
3385
end rec
0 commit comments