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