diff options
author | Martin Odersky <odersky@gmail.com> | 2015-11-07 22:49:21 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-11-09 15:45:39 +0100 |
commit | af6ffc319cb23c5ade01251a93810f7a33429e58 (patch) | |
tree | 99dd27434fcc4fd37aeaae359ea5d0e1f9700767 /src/dotty/tools/dotc/transform | |
parent | 5398c5a723b0f8b0d35e6c3ad230c5046169e837 (diff) | |
download | dotty-af6ffc319cb23c5ade01251a93810f7a33429e58.tar.gz dotty-af6ffc319cb23c5ade01251a93810f7a33429e58.tar.bz2 dotty-af6ffc319cb23c5ade01251a93810f7a33429e58.zip |
Renamings in Definitions
TypeRef becomes Type, thus removing duplicates. Where
...Type was used in an extraction (e.g. ArrayType(...),
FunctionType(...)), we now use ...Of.
Diffstat (limited to 'src/dotty/tools/dotc/transform')
6 files changed, 9 insertions, 9 deletions
diff --git a/src/dotty/tools/dotc/transform/ClassTags.scala b/src/dotty/tools/dotc/transform/ClassTags.scala index 2ad348b05..a7c4779c3 100644 --- a/src/dotty/tools/dotc/transform/ClassTags.scala +++ b/src/dotty/tools/dotc/transform/ClassTags.scala @@ -44,7 +44,7 @@ class ClassTags extends MiniPhaseTransform with IdentityDenotTransformer { thisT val tp = tree.args.head.tpe val defn = ctx.definitions val (elemType, ndims) = tp match { - case defn.MultiArrayType(elem, ndims) => (elem, ndims) + case defn.MultiArrayOf(elem, ndims) => (elem, ndims) case _ => (tp, 0) } diff --git a/src/dotty/tools/dotc/transform/ElimByName.scala b/src/dotty/tools/dotc/transform/ElimByName.scala index 2d0ecaf99..b65a46249 100644 --- a/src/dotty/tools/dotc/transform/ElimByName.scala +++ b/src/dotty/tools/dotc/transform/ElimByName.scala @@ -120,7 +120,7 @@ class ElimByName extends MiniPhaseTransform with InfoTransformer { thisTransform else tree def transformInfo(tp: Type, sym: Symbol)(implicit ctx: Context): Type = tp match { - case ExprType(rt) if exprBecomesFunction(sym) => defn.FunctionType(Nil, rt) + case ExprType(rt) if exprBecomesFunction(sym) => defn.FunctionOf(Nil, rt) case _ => tp } diff --git a/src/dotty/tools/dotc/transform/ElimRepeated.scala b/src/dotty/tools/dotc/transform/ElimRepeated.scala index 9563a7ed0..98abbb26d 100644 --- a/src/dotty/tools/dotc/transform/ElimRepeated.scala +++ b/src/dotty/tools/dotc/transform/ElimRepeated.scala @@ -81,7 +81,7 @@ class ElimRepeated extends MiniPhaseTransform with InfoTransformer with Annotati .select(nme.seqToArray) .appliedToType(elemType) .appliedTo(tree, Literal(Constant(elemClass.typeRef))) - .ensureConforms(defn.ArrayType(elemType)) + .ensureConforms(defn.ArrayOf(elemType)) // Because of phantomclasses, the Java array's type might not conform to the return type } diff --git a/src/dotty/tools/dotc/transform/NonLocalReturns.scala b/src/dotty/tools/dotc/transform/NonLocalReturns.scala index a58a0fbda..7680e283e 100644 --- a/src/dotty/tools/dotc/transform/NonLocalReturns.scala +++ b/src/dotty/tools/dotc/transform/NonLocalReturns.scala @@ -29,7 +29,7 @@ class NonLocalReturns extends MiniPhaseTransform { thisTransformer => /** The type of a non-local return expression with given argument type */ private def nonLocalReturnExceptionType(argtype: Type)(implicit ctx: Context) = - defn.NonLocalReturnControlTypeRef.appliedTo(argtype) + defn.NonLocalReturnControlType.appliedTo(argtype) /** A hashmap from method symbols to non-local return keys */ private val nonLocalReturnKeys = mutable.Map[Symbol, TermSymbol]() @@ -50,7 +50,7 @@ class NonLocalReturns extends MiniPhaseTransform { thisTransformer => private def nonLocalReturnThrow(expr: Tree, meth: Symbol)(implicit ctx: Context) = Throw( New( - defn.NonLocalReturnControlTypeRef, + defn.NonLocalReturnControlType, ref(nonLocalReturnKey(meth)) :: expr.ensureConforms(defn.ObjectType) :: Nil)) /** Transform (body, key) to: @@ -68,7 +68,7 @@ class NonLocalReturns extends MiniPhaseTransform { thisTransformer => */ private def nonLocalReturnTry(body: Tree, key: TermSymbol, meth: Symbol)(implicit ctx: Context) = { val keyDef = ValDef(key, New(defn.ObjectType, Nil)) - val nonLocalReturnControl = defn.NonLocalReturnControlTypeRef + val nonLocalReturnControl = defn.NonLocalReturnControlType val ex = ctx.newSymbol(meth, nme.ex, EmptyFlags, nonLocalReturnControl, coord = body.pos) val pat = BindTyped(ex, nonLocalReturnControl) val rhs = If( diff --git a/src/dotty/tools/dotc/transform/PatternMatcher.scala b/src/dotty/tools/dotc/transform/PatternMatcher.scala index 4b45f7cc2..5b4d42683 100644 --- a/src/dotty/tools/dotc/transform/PatternMatcher.scala +++ b/src/dotty/tools/dotc/transform/PatternMatcher.scala @@ -201,7 +201,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans // catchAll.isEmpty iff no synthetic default case needed (the (last) user-defined case is a default) // if the last user-defined case is a default, it will never jump to the next case; it will go immediately to matchEnd val catchAllDef = matchFailGen.map { _(scrutSym)} - .getOrElse(Throw(New(defn.MatchErrorTypeRef, List(ref(scrutSym))))) + .getOrElse(Throw(New(defn.MatchErrorType, List(ref(scrutSym))))) val matchFail = newSynthCaseLabel(ctx.freshName("matchFail"), MethodType(Nil, restpe)) val catchAllDefBody = DefDef(matchFail, catchAllDef) @@ -878,7 +878,7 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans // unlike in scalac SubstOnlyTreeMakers are maintained. val casesRebindingPropagated = casesRaw map (propagateRebindings(_, NoRebindings)) - def matchFailGen = matchFailGenOverride orElse Some((arg: Symbol) => Throw(New(defn.MatchErrorTypeRef, List(ref(arg))))) + def matchFailGen = matchFailGenOverride orElse Some((arg: Symbol) => Throw(New(defn.MatchErrorType, List(ref(arg))))) ctx.debuglog("combining cases: " + (casesRebindingPropagated.map(_.mkString(" >> ")).mkString("{", "\n", "}"))) diff --git a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala index 035cbb51b..c57d6fd1a 100644 --- a/src/dotty/tools/dotc/transform/TypeTestsCasts.scala +++ b/src/dotty/tools/dotc/transform/TypeTestsCasts.scala @@ -68,7 +68,7 @@ trait TypeTestsCasts { } } } - case defn.MultiArrayType(elem, ndims) if isUnboundedGeneric(elem) => + case defn.MultiArrayOf(elem, ndims) if isUnboundedGeneric(elem) => def isArrayTest(arg: Tree) = ref(defn.runtimeMethodRef(nme.isArray)).appliedTo(arg, Literal(Constant(ndims))) if (ndims == 1) isArrayTest(qual) |