summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Typers.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-04-09 10:12:03 -0700
committerPaul Phillips <paulp@improving.org>2012-04-09 19:43:38 -0700
commitc456bebbcddae490a2ab2860855e936adb60539e (patch)
tree977cded8b50c1efa7e12bc2aee55d62fa91641d7 /src/compiler/scala/tools/nsc/typechecker/Typers.scala
parent54496744806e9617d8ab745122080c48f60c64e7 (diff)
downloadscala-c456bebbcddae490a2ab2860855e936adb60539e.tar.gz
scala-c456bebbcddae490a2ab2860855e936adb60539e.tar.bz2
scala-c456bebbcddae490a2ab2860855e936adb60539e.zip
Less laborious type application.
And eliminating redundancy. Reduced gratuitous usage of typeConstructor on symbols which don't have type parameters.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Typers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index 76e1d40af9..f558e0afc7 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -186,7 +186,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser {
}
val result = wrapImplicit(from)
if (result != EmptyTree) result
- else wrapImplicit(appliedType(ByNameParamClass.typeConstructor, List(from)))
+ else wrapImplicit(byNameType(from))
}
}
@@ -2166,8 +2166,8 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser {
def translateMatch(selector1: Tree, selectorTp: Type, casesAdapted: List[CaseDef], ownType: Type, doTranslation: Boolean, matchFailGen: Option[Tree => Tree] = None) = {
def repeatedToSeq(tp: Type): Type = (tp baseType RepeatedParamClass) match {
- case TypeRef(_, RepeatedParamClass, args) => appliedType(SeqClass.typeConstructor, args)
- case _ => tp
+ case TypeRef(_, RepeatedParamClass, arg :: Nil) => seqType(arg)
+ case _ => tp
}
if (!doTranslation) { // a switch
@@ -2240,7 +2240,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser {
val (selector1, selectorTp, casesAdapted, resTp, doTranslation) = methodBodyTyper.prepareTranslateMatch(selector, cases, mode, ptRes)
val methFormals = paramSyms map (_.tpe)
- val parents = List(appliedType(AbstractFunctionClass(arity).typeConstructor, methFormals :+ resTp), SerializableClass.tpe)
+ val parents = List(abstractFunctionType(methFormals, resTp), SerializableClass.tpe)
anonClass setInfo ClassInfoType(parents, newScope, anonClass)
methodSym setInfoAndEnter MethodType(paramSyms, resTp)
@@ -3555,7 +3555,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser {
treeCopy.ArrayValue(tree, elemtpt1, elems1)
.setType(
(if (isFullyDefined(pt) && !phase.erasedTypes) pt
- else appliedType(ArrayClass.typeConstructor, List(elemtpt1.tpe))).notNull)
+ else arrayType(elemtpt1.tpe)).notNull)
}
def typedAssign(lhs: Tree, rhs: Tree): Tree = {