Skip to content

Commit 1ade2b8

Browse files
committed
refactor definitions
1 parent e9ce033 commit 1ade2b8

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class Definitions {
357357
@tu lazy val ScalaRuntimeModule: Symbol = ctx.requiredModule("scala.runtime.ScalaRunTime")
358358
def runtimeMethodRef(name: PreName): TermRef = ScalaRuntimeModule.requiredMethodRef(name)
359359
def ScalaRuntime_drop: Symbol = runtimeMethodRef(nme.drop).symbol
360-
@tu lazy val ScalaRuntime__hashCode: Symbol = runtimeMethodRef("_hashCode").symbol
360+
@tu lazy val ScalaRuntime__hashCode: Symbol = ScalaRuntimeModule.requiredMethod(nme._hashCode_)
361361

362362
@tu lazy val BoxesRunTimeModule: Symbol = ctx.requiredModule("scala.runtime.BoxesRunTime")
363363
@tu lazy val ScalaStaticsModule: Symbol = ctx.requiredModule("scala.runtime.Statics")

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,7 @@ object StdNames {
449449
val getOrElse: N = "getOrElse"
450450
val hasNext: N = "hasNext"
451451
val hashCode_ : N = "hashCode"
452+
val _hashCode_ : N = "_hashCode"
452453
val hash_ : N = "hash"
453454
val head: N = "head"
454455
val higherKinds: N = "higherKinds"

compiler/src/dotty/tools/dotc/transform/SyntheticMembers.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,10 @@ class SyntheticMembers(thisPhase: DenotTransformer) {
258258
def chooseHashcode(implicit ctx: Context) = {
259259
if (clazz.is(ModuleClass))
260260
Literal(Constant(clazz.name.stripModuleClassSuffix.toString.hashCode))
261-
else if (accessors `exists` (_.info.finalResultType.classSymbol.isPrimitiveValueClass))
261+
else if (accessors.exists(_.info.finalResultType.classSymbol.isPrimitiveValueClass))
262262
caseHashCodeBody
263263
else
264-
ref(defn.ScalaRuntimeModule).select(defn.ScalaRuntime__hashCode).appliedTo(This(clazz))
264+
ref(defn.ScalaRuntime__hashCode).appliedTo(This(clazz))
265265
}
266266

267267
/** The class

0 commit comments

Comments
 (0)