Skip to content

Commit 1abbf4e

Browse files
committed
Use perRun for Definition members #3
1 parent 2bac1fe commit 1abbf4e

31 files changed

+319
-458
lines changed

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
139139
val externalEqualsNumNum: Symbol = defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumNum)
140140
val externalEqualsNumChar: Symbol = NoSymbol // ctx.requiredMethod(BoxesRunTimeTypeRef, nme.equalsNumChar) // this method is private
141141
val externalEqualsNumObject: Symbol = defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumObject)
142-
val externalEquals: Symbol = defn.BoxesRunTimeClass.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol
142+
val externalEquals: Symbol = defn.BoxesRunTimeModule.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol
143143
val MaxFunctionArity: Int = Definitions.MaxImplementedFunctionArity
144144
val FunctionClass: Array[Symbol] = defn.FunctionClassPerRun()
145145
val AbstractFunctionClass: Array[Symbol] = defn.AbstractFunctionClassPerRun()

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1636,7 +1636,7 @@ class JSCodeGen()(implicit ctx: Context) {
16361636
private lazy val externalEqualsNumObject: Symbol =
16371637
defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumObject)
16381638
private lazy val externalEquals: Symbol =
1639-
defn.BoxesRunTimeClass.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol
1639+
defn.BoxesRunTimeModule.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol
16401640

16411641
/** Gen JS code for a call to Any.== */
16421642
private def genEqEqPrimitive(ltpe: Type, rtpe: Type, lsrc: js.Tree, rsrc: js.Tree)(

compiler/src/dotty/tools/dotc/ast/Desugar.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ object desugar {
641641
else if (isObject)
642642
parents1 = parents1 :+ scalaDot(nme.Serializable.toTypeName)
643643
if (isEnum)
644-
parents1 = parents1 :+ ref(defn.EnumType)
644+
parents1 = parents1 :+ ref(defn.EnumClass.typeRef)
645645

646646
// derived type classes of non-module classes go to their companions
647647
val (clsDerived, companionDerived) =
@@ -984,7 +984,7 @@ object desugar {
984984
def makeSelector(sel: Tree, checkMode: MatchCheck)(implicit ctx: Context): Tree =
985985
if (checkMode == MatchCheck.Exhaustive) sel
986986
else {
987-
val sel1 = Annotated(sel, New(ref(defn.UncheckedAnnotType)))
987+
val sel1 = Annotated(sel, New(ref(defn.UncheckedAnnot.typeRef)))
988988
if (checkMode != MatchCheck.None) sel1.pushAttachment(CheckIrrefutable, checkMode)
989989
sel1
990990
}
@@ -1560,7 +1560,7 @@ object desugar {
15601560
val seqType = if (ctx.compilationUnit.isJava) defn.ArrayType else defn.SeqType
15611561
Annotated(
15621562
AppliedTypeTree(ref(seqType), t),
1563-
New(ref(defn.RepeatedAnnotType), Nil :: Nil))
1563+
New(ref(defn.RepeatedAnnot.typeRef), Nil :: Nil))
15641564
} else {
15651565
assert(ctx.mode.isExpr || ctx.reporter.errorsReported || ctx.mode.is(Mode.Interactive), ctx.mode)
15661566
Select(t, op.name)

compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ object DesugarEnums {
9898
.withFlags(Synthetic)
9999
val privateValuesDef =
100100
ValDef(nme.DOLLAR_VALUES, TypeTree(),
101-
New(TypeTree(defn.EnumValuesType.appliedTo(enumClass.typeRef :: Nil)), ListOfNil))
101+
New(TypeTree(defn.EnumValuesClass.typeRef.appliedTo(enumClass.typeRef :: Nil)), ListOfNil))
102102
.withFlags(Private)
103103

104104
val valuesOfExnMessage = Apply(

compiler/src/dotty/tools/dotc/ast/tpd.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
13511351

13521352
/** Creates the nested pairs type tree repesentation of the type trees in `ts` */
13531353
def nestedPairsTypeTree(ts: List[Tree])(implicit ctx: Context): Tree =
1354-
ts.foldRight[Tree](TypeTree(defn.UnitType))((x, acc) => AppliedTypeTree(TypeTree(defn.PairType), x :: acc :: Nil))
1354+
ts.foldRight[Tree](TypeTree(defn.UnitType))((x, acc) => AppliedTypeTree(TypeTree(defn.PairClass.typeRef), x :: acc :: Nil))
13551355

13561356
/** Replaces all positions in `tree` with zero-extent positions */
13571357
private def focusPositions(tree: Tree)(implicit ctx: Context): Tree = {

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ object Annotations {
163163
def later(delayedSym: given Context => Symbol, span: Span)(implicit ctx: Context): Annotation = {
164164
def makeChildLater(implicit ctx: Context) = {
165165
val sym = delayedSym
166-
New(defn.ChildAnnotType.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
166+
New(defn.ChildAnnot.typeRef.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
167167
.withSpan(span)
168168
}
169169
deferred(defn.ChildAnnot)(makeChildLater(ctx))
@@ -202,7 +202,7 @@ object Annotations {
202202

203203
def ThrowsAnnotation(cls: ClassSymbol)(implicit ctx: Context): Annotation = {
204204
val tref = cls.typeRef
205-
Annotation(defn.ThrowsAnnotType.appliedTo(tref), Ident(tref))
205+
Annotation(defn.ThrowsAnnot.typeRef.appliedTo(tref), Ident(tref))
206206
}
207207

208208
/** A decorator that provides queries for specific annotations

0 commit comments

Comments
 (0)