aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-11-11 17:01:30 +0100
committerMartin Odersky <odersky@gmail.com>2016-11-11 17:01:30 +0100
commit49cef124a7be97647db3ccdbb0b775f53e5265d0 (patch)
tree4c8bd34a5f8050890adb409821c0c4023195500f /src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
parent49022717bc0e8c0de8834f4cde5021e1da8c0ea0 (diff)
downloaddotty-49cef124a7be97647db3ccdbb0b775f53e5265d0.tar.gz
dotty-49cef124a7be97647db3ccdbb0b775f53e5265d0.tar.bz2
dotty-49cef124a7be97647db3ccdbb0b775f53e5265d0.zip
Replace PolyType.fromSymbols with LambdaAbstract
As a side effect, avoid creating synthetic parameters in lambda abstract.
Diffstat (limited to 'src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala')
-rw-r--r--src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
index 70148b3e2..b01f6cc6a 100644
--- a/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
+++ b/src/dotty/tools/dotc/core/unpickleScala2/Scala2Unpickler.scala
@@ -40,29 +40,15 @@ object Scala2Unpickler {
/** Temporary type for classinfos, will be decomposed on completion of the class */
case class TempClassInfoType(parentTypes: List[Type], decls: Scope, clazz: Symbol) extends UncachedGroundType
- /** Convert temp poly type to some native Dotty idiom.
- * @param denot The denotation that gets the converted type as info.
- * If `denot` is not an abstract type, this simply returns an equivalent `PolyType`.
- * If `denot` is an abstract type, it converts a
- *
- * TempPolyType(List(v_1 T_1, ..., v_n T_n), lo .. hi)
- *
- * to a type lambda using `parameterizeWith/LambdaAbstract`.
- */
- def depoly(tp: Type, denot: SymDenotation)(implicit ctx: Context): Type = tp match {
- case TempPolyType(tparams, restpe) =>
- if (denot.isType) {
- assert(!denot.isClass)
- restpe.LambdaAbstract(tparams)
- }
- else
- PolyType.fromSymbols(tparams, restpe)
+ /** Convert temp poly type to poly type and leave other types alone. */
+ def translateTempPoly(tp: Type)(implicit ctx: Context): Type = tp match {
+ case TempPolyType(tparams, restpe) => restpe.LambdaAbstract(tparams)
case tp => tp
}
def addConstructorTypeParams(denot: SymDenotation)(implicit ctx: Context) = {
assert(denot.isConstructor)
- denot.info = PolyType.fromSymbols(denot.owner.typeParams, denot.info)
+ denot.info = denot.info.LambdaAbstract(denot.owner.typeParams)
}
/** Convert array parameters denoting a repeated parameter of a Java method
@@ -549,7 +535,7 @@ class Scala2Unpickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClas
val selfInfo = if (atEnd) NoType else readTypeRef()
setClassInfo(denot, tp, selfInfo)
case denot =>
- val tp1 = depoly(tp, denot)
+ val tp1 = translateTempPoly(tp)
denot.info =
if (tag == ALIASsym) TypeAlias(tp1)
else if (denot.isType) checkNonCyclic(denot.symbol, tp1, reportErrors = false)