aboutsummaryrefslogtreecommitdiff
path: root/compiler/src/dotty/tools/dotc/core
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2017-03-31 09:52:33 +0200
committerMartin Odersky <odersky@gmail.com>2017-04-11 09:33:12 +0200
commite3e5e79e24503a2e6be7f708d81c27068664b893 (patch)
treeca0459f93fb7b2644217aa5a01615b46d926b0af /compiler/src/dotty/tools/dotc/core
parent0ffa6d865b7a77b2d0a44306691c767d47ab4e08 (diff)
downloaddotty-e3e5e79e24503a2e6be7f708d81c27068664b893.tar.gz
dotty-e3e5e79e24503a2e6be7f708d81c27068664b893.tar.bz2
dotty-e3e5e79e24503a2e6be7f708d81c27068664b893.zip
Avoid duplicate hashCode/equals
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core')
-rw-r--r--compiler/src/dotty/tools/dotc/core/Names.scala4
-rw-r--r--compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala2
2 files changed, 2 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Names.scala b/compiler/src/dotty/tools/dotc/core/Names.scala
index 37df9cd24..d1412c35c 100644
--- a/compiler/src/dotty/tools/dotc/core/Names.scala
+++ b/compiler/src/dotty/tools/dotc/core/Names.scala
@@ -105,6 +105,7 @@ object Names {
def lastIndexOfSlice(str: String): Int = lastPart.toString.lastIndexOfSlice(str)
def lastIndexOfSlice(name: Name): Int = lastIndexOfSlice(name.toString)
+ override def hashCode = System.identityHashCode(this)
override def equals(that: Any) = this eq that.asInstanceOf[AnyRef]
}
@@ -196,9 +197,6 @@ object Names {
thisKind == kind ||
!thisKind.definesNewName && thisKind.tag > kind.tag && underlying.is(kind)
}
-
- override def hashCode = System.identityHashCode(this)
- override def equals(other: Any) = this eq other.asInstanceOf[AnyRef]
}
class SimpleTermName(val start: Int, val length: Int, @sharable private[Names] var next: SimpleTermName) extends TermName {
diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala b/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
index 602bdeb02..d1997376d 100644
--- a/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
+++ b/compiler/src/dotty/tools/dotc/core/tasty/TastyFormat.scala
@@ -223,8 +223,8 @@ object TastyFormat {
final val UTF8 = 1
final val QUALIFIED = 2
final val FLATTENED = 3
- final val EXPANDPREFIX = 5
final val EXPANDED = 4
+ final val EXPANDPREFIX = 5
final val TRAITSETTER = 6
final val UNIQUE = 10
final val DEFAULTGETTER = 11