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