File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -284,26 +284,26 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
284
284
given Context = ctx // optimization for performance
285
285
val info2 = tp2.info
286
286
287
- /** Does `tp2` have a stable prefix or NoPrefix as a prefix ?
287
+ /** Does `tp2` have a stable prefix?
288
288
* If that's not the case, following an alias via asSeenFrom could be lossy
289
289
* so we should not conclude `false` if comparing aliases fails.
290
290
* See pos/i17064.scala for a test case
291
291
*/
292
- def hasPrecisePrefix (tp : NamedType ) =
293
- tp.prefix.isStable || tp.prefix == NoPrefix
292
+ def hasStablePrefix (tp : NamedType ) =
293
+ tp.prefix.isStable
294
294
295
295
info2 match
296
296
case info2 : TypeAlias =>
297
297
if recur(tp1, info2.alias) then return true
298
- if tp2.asInstanceOf [TypeRef ].canDropAlias && hasPrecisePrefix (tp2) then
298
+ if tp2.asInstanceOf [TypeRef ].canDropAlias && hasStablePrefix (tp2) then
299
299
return false
300
300
case _ =>
301
301
tp1 match
302
302
case tp1 : NamedType =>
303
303
tp1.info match {
304
304
case info1 : TypeAlias =>
305
305
if recur(info1.alias, tp2) then return true
306
- if tp1.asInstanceOf [TypeRef ].canDropAlias && hasPrecisePrefix (tp2) then
306
+ if tp1.asInstanceOf [TypeRef ].canDropAlias && hasStablePrefix (tp2) then
307
307
return false
308
308
case _ =>
309
309
}
You can’t perform that action at this time.
0 commit comments