Skip to content

Commit 2c35cb1

Browse files
committed
Fix equals for TypeAlias
1 parent fe6ed66 commit 2c35cb1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3598,6 +3598,8 @@ object Types {
35983598
// @!!! we are not systematic when we do referntial vs structural comparisons.
35993599
// Do referential everywhere?
36003600
override def equals(that: Any): Boolean = that match {
3601+
case that: TypeAlias =>
3602+
false
36013603
case that: TypeBounds =>
36023604
(this.lo eq that.lo) && (this.hi eq that.hi)
36033605
case _ =>
@@ -3615,6 +3617,13 @@ object Types {
36153617
if (alias eq this.alias) this else TypeAlias(alias)
36163618

36173619
override def computeHash = doHash(alias)
3620+
3621+
override def equals(that: Any): Boolean = that match {
3622+
case that: TypeAlias =>
3623+
this.alias eq that.alias
3624+
case _ =>
3625+
false
3626+
}
36183627
}
36193628

36203629
class CachedTypeAlias(alias: Type) extends TypeAlias(alias)

0 commit comments

Comments
 (0)