@@ -3363,29 +3363,15 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
3363
3363
stableScrut.member(typeMemberName) match
3364
3364
case denot : SingleDenotation if denot.exists =>
3365
3365
val info = denot.info match
3366
- case TypeAlias (alias) => alias
3367
- case info => info // Notably, RealTypeBounds, which will eventually give a MatchResult.NoInstances
3366
+ case TypeAlias (alias) => alias // Extract the alias
3367
+ case ClassInfo (prefix, cls, _, _, _) => prefix.select(cls) // Re-select the class from the prefix
3368
+ case info => info // Notably, RealTypeBounds, which will eventually give a MatchResult.NoInstances
3368
3369
val infoRefersToSkolem = stableScrut.isInstanceOf [SkolemType ] && stableScrut.occursIn(info)
3369
- if infoRefersToSkolem && info.isInstanceOf [ClassInfo ] then
3370
- /* We would like to create a `RealTypeBounds(info, info)` to get a `MatchResult.NoInstances`
3371
- * but that is not allowed for `ClassInfo`. So instead we return `false`, which will result
3372
- * in a `MatchResult.Stuck` instead.
3373
- */
3374
- false
3375
- else
3376
- val info1 = info match
3377
- case ClassInfo (prefix, cls, _, _, _) =>
3378
- // Re-select the class from the prefix
3379
- prefix.select(cls)
3380
- case info : TypeBounds =>
3381
- // Will already trigger a MatchResult.NoInstances
3382
- info
3383
- case _ if infoRefersToSkolem =>
3384
- // Explicitly trigger a MatchResult.NoInstances
3385
- RealTypeBounds (info, info)
3386
- case _ =>
3387
- info
3388
- rec(capture, info1, variance = 0 , scrutIsWidenedAbstract)
3370
+ val info1 = info match
3371
+ case info : TypeBounds => info // Will already trigger a MatchResult.NoInstances
3372
+ case _ if infoRefersToSkolem => RealTypeBounds (info, info) // Explicitly trigger a MatchResult.NoInstances
3373
+ case _ => info // We have a match
3374
+ rec(capture, info1, variance = 0 , scrutIsWidenedAbstract)
3389
3375
case _ =>
3390
3376
false
3391
3377
end rec
0 commit comments