diff options
author | Martin Odersky <odersky@gmail.com> | 2014-06-18 18:20:14 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-06-18 18:21:07 +0200 |
commit | 7f721438b5bccc8ca9dd68cef273c8cac8199e1a (patch) | |
tree | a619fb770fee578354c7fca1f1c30c68f0d542d0 /src/dotty/tools/dotc/core/pickling/UnPickler.scala | |
parent | 388d9a889c6929699e879a307dc80145b906390a (diff) | |
download | dotty-7f721438b5bccc8ca9dd68cef273c8cac8199e1a.tar.gz dotty-7f721438b5bccc8ca9dd68cef273c8cac8199e1a.tar.bz2 dotty-7f721438b5bccc8ca9dd68cef273c8cac8199e1a.zip |
Handling higher-kinded types with lambdas
Switch to the new scheme where higher-kinded types (and also some polymorphic
type aliases) are represented as instances of Lambda traits.
Diffstat (limited to 'src/dotty/tools/dotc/core/pickling/UnPickler.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/pickling/UnPickler.scala | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala index 622752570..dd26b20df 100644 --- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala +++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala @@ -42,15 +42,15 @@ object UnPickler { * * TempPolyType(List(v_1 T_1, ..., v_n T_n), lo .. hi) * - * to a higher-kinded type appoximation (@see TypeBounds.higherKinded) - */ + * 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.isAbstractType) - restpe.bounds.higherKinded(tparams) + restpe.LambdaAbstract(tparams) // bounds needed? else if (denot.isAliasType) { var err: Option[(String, Position)] = None - val result = restpe.LambdaAbstract(tparams) { (msg, pos) => err = Some((msg, pos)) } + val result = restpe.parameterizeWith(tparams) for ((msg, pos) <- err) ctx.warning( s"""$msg @@ -571,6 +571,8 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot: case info => tp.derivedRefinedType(parent1, name, info) } + case tp @ TypeRef(pre, tpnme.Apply) if pre.isLambda => + elim(pre) case _ => tp } |