Skip to content

Commit

Permalink
Align tests in TypeComparer and AsSeenFrom
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Mar 18, 2023
1 parent 2ac2315 commit c8efe69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,13 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
given Context = ctx // optimization for performance
val info2 = tp2.info

/** Does `tp2` have a singleton type or NoPrefix as a prefix?
/** Does `tp2` have a stable prefix or NoPrefix as a prefix?
* If that's not the case, following an alias via asSeenFrom could be lossy
* so we should not conclude `false` if comparing aliases fails.
* See pos/i17064.scala for a test case
*/
def hasPrecisePrefix(tp: NamedType) =
tp.prefix.isSingleton || tp.prefix == NoPrefix
tp.prefix.isStable || tp.prefix == NoPrefix

info2 match
case info2: TypeAlias =>
Expand Down

0 comments on commit c8efe69

Please sign in to comment.