diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index 0676760cf52b..919c11f1776c 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -357,7 +357,7 @@ class Definitions { @tu lazy val ScalaRuntimeModule: Symbol = ctx.requiredModule("scala.runtime.ScalaRunTime") def runtimeMethodRef(name: PreName): TermRef = ScalaRuntimeModule.requiredMethodRef(name) def ScalaRuntime_drop: Symbol = runtimeMethodRef(nme.drop).symbol - @tu lazy val ScalaRuntime__hashCode: Symbol = runtimeMethodRef("_hashCode").symbol + @tu lazy val ScalaRuntime__hashCode: Symbol = ScalaRuntimeModule.requiredMethod(nme._hashCode_) @tu lazy val BoxesRunTimeModule: Symbol = ctx.requiredModule("scala.runtime.BoxesRunTime") @tu lazy val ScalaStaticsModule: Symbol = ctx.requiredModule("scala.runtime.Statics") diff --git a/compiler/src/dotty/tools/dotc/core/StdNames.scala b/compiler/src/dotty/tools/dotc/core/StdNames.scala index ecd046d25744..a25996e7d9aa 100644 --- a/compiler/src/dotty/tools/dotc/core/StdNames.scala +++ b/compiler/src/dotty/tools/dotc/core/StdNames.scala @@ -449,6 +449,7 @@ object StdNames { val getOrElse: N = "getOrElse" val hasNext: N = "hasNext" val hashCode_ : N = "hashCode" + val _hashCode_ : N = "_hashCode" val hash_ : N = "hash" val head: N = "head" val higherKinds: N = "higherKinds" diff --git a/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala b/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala index 9c975f4636df..0b189dcb7b1b 100644 --- a/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala +++ b/compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala @@ -258,10 +258,10 @@ class SyntheticMembers(thisPhase: DenotTransformer) { def chooseHashcode(implicit ctx: Context) = { if (clazz.is(ModuleClass)) Literal(Constant(clazz.name.stripModuleClassSuffix.toString.hashCode)) - else if (accessors `exists` (_.info.finalResultType.classSymbol.isPrimitiveValueClass)) + else if (accessors.exists(_.info.finalResultType.classSymbol.isPrimitiveValueClass)) caseHashCodeBody else - ref(defn.ScalaRuntimeModule).select(defn.ScalaRuntime__hashCode).appliedTo(This(clazz)) + ref(defn.ScalaRuntime__hashCode).appliedTo(This(clazz)) } /** The class