Skip to content

Commit

Permalink
Revert: Use perRun for Definition members #3
Browse files Browse the repository at this point in the history
(reverted from commit 1abbf4e)
  • Loading branch information
odersky committed Jul 29, 2019
1 parent 0b52037 commit c6b1fa2
Show file tree
Hide file tree
Showing 31 changed files with 445 additions and 306 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class DottyBackendInterface(outputDirectory: AbstractFile, val superCallsMap: Ma
val externalEqualsNumNum: Symbol = defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumNum)
val externalEqualsNumChar: Symbol = NoSymbol // ctx.requiredMethod(BoxesRunTimeTypeRef, nme.equalsNumChar) // this method is private
val externalEqualsNumObject: Symbol = defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumObject)
val externalEquals: Symbol = defn.BoxesRunTimeModule.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol
val externalEquals: Symbol = defn.BoxesRunTimeClass.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol
val MaxFunctionArity: Int = Definitions.MaxImplementedFunctionArity
val FunctionClass: Array[Symbol] = defn.FunctionClassPerRun()
val AbstractFunctionClass: Array[Symbol] = defn.AbstractFunctionClassPerRun()
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,7 @@ class JSCodeGen()(implicit ctx: Context) {
private lazy val externalEqualsNumObject: Symbol =
defn.BoxesRunTimeModule.requiredMethod(nme.equalsNumObject)
private lazy val externalEquals: Symbol =
defn.BoxesRunTimeModule.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol
defn.BoxesRunTimeClass.info.decl(nme.equals_).suchThat(toDenot(_).info.firstParamTypes.size == 2).symbol

/** Gen JS code for a call to Any.== */
private def genEqEqPrimitive(ltpe: Type, rtpe: Type, lsrc: js.Tree, rsrc: js.Tree)(
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/ast/Desugar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ object desugar {
else if (isObject)
parents1 = parents1 :+ scalaDot(nme.Serializable.toTypeName)
if (isEnum)
parents1 = parents1 :+ ref(defn.EnumClass.typeRef)
parents1 = parents1 :+ ref(defn.EnumType)

// derived type classes of non-module classes go to their companions
val (clsDerived, companionDerived) =
Expand Down Expand Up @@ -984,7 +984,7 @@ object desugar {
def makeSelector(sel: Tree, checkMode: MatchCheck)(implicit ctx: Context): Tree =
if (checkMode == MatchCheck.Exhaustive) sel
else {
val sel1 = Annotated(sel, New(ref(defn.UncheckedAnnot.typeRef)))
val sel1 = Annotated(sel, New(ref(defn.UncheckedAnnotType)))
if (checkMode != MatchCheck.None) sel1.pushAttachment(CheckIrrefutable, checkMode)
sel1
}
Expand Down Expand Up @@ -1561,7 +1561,7 @@ object desugar {
val seqType = if (ctx.compilationUnit.isJava) defn.ArrayType else defn.SeqType
Annotated(
AppliedTypeTree(ref(seqType), t),
New(ref(defn.RepeatedAnnot.typeRef), Nil :: Nil))
New(ref(defn.RepeatedAnnotType), Nil :: Nil))
} else {
assert(ctx.mode.isExpr || ctx.reporter.errorsReported || ctx.mode.is(Mode.Interactive), ctx.mode)
Select(t, op.name)
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/DesugarEnums.scala
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ object DesugarEnums {
.withFlags(Synthetic)
val privateValuesDef =
ValDef(nme.DOLLAR_VALUES, TypeTree(),
New(TypeTree(defn.EnumValuesClass.typeRef.appliedTo(enumClass.typeRef :: Nil)), ListOfNil))
New(TypeTree(defn.EnumValuesType.appliedTo(enumClass.typeRef :: Nil)), ListOfNil))
.withFlags(Private)

val valuesOfExnMessage = Apply(
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/ast/tpd.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {

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

/** Replaces all positions in `tree` with zero-extent positions */
private def focusPositions(tree: Tree)(implicit ctx: Context): Tree = {
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Annotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ object Annotations {
def later(delayedSym: given Context => Symbol, span: Span)(implicit ctx: Context): Annotation = {
def makeChildLater(implicit ctx: Context) = {
val sym = delayedSym
New(defn.ChildAnnot.typeRef.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
New(defn.ChildAnnotType.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
.withSpan(span)
}
deferred(defn.ChildAnnot)(makeChildLater(ctx))
Expand Down Expand Up @@ -193,7 +193,7 @@ object Annotations {

def ThrowsAnnotation(cls: ClassSymbol)(implicit ctx: Context): Annotation = {
val tref = cls.typeRef
Annotation(defn.ThrowsAnnot.typeRef.appliedTo(tref), Ident(tref))
Annotation(defn.ThrowsAnnotType.appliedTo(tref), Ident(tref))
}

/** A decorator that provides queries for specific annotations
Expand Down
Loading

0 comments on commit c6b1fa2

Please sign in to comment.