diff options
author | Martin Odersky <odersky@gmail.com> | 2015-12-02 13:21:43 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-12-06 16:09:20 +0100 |
commit | e63f0585c7f120dbc8d9965d8729e831efd2f2ae (patch) | |
tree | eb9c55696b80607e2693bc29a18c40bd2bcb6168 /src/dotty/tools/dotc/core/TypeApplications.scala | |
parent | 7eeb5657497536ebafd7bbf80ea74fbc805a3b77 (diff) | |
download | dotty-e63f0585c7f120dbc8d9965d8729e831efd2f2ae.tar.gz dotty-e63f0585c7f120dbc8d9965d8729e831efd2f2ae.tar.bz2 dotty-e63f0585c7f120dbc8d9965d8729e831efd2f2ae.zip |
Use typeapp extractors for printing
Diffstat (limited to 'src/dotty/tools/dotc/core/TypeApplications.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/TypeApplications.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/TypeApplications.scala b/src/dotty/tools/dotc/core/TypeApplications.scala index 3ce1c1cc4..1d11645a4 100644 --- a/src/dotty/tools/dotc/core/TypeApplications.scala +++ b/src/dotty/tools/dotc/core/TypeApplications.scala @@ -53,6 +53,8 @@ object TypeApplications { case nil => parent } + assert(variances.nonEmpty) + assert(argBoundss.length == variances.length) RefinedType( argRefinements(defn.LambdaTrait(variances).typeRef, 0, argBoundss), tpnme.hkApply, rt => bodyFn(rt).bounds) @@ -60,7 +62,8 @@ object TypeApplications { def unapply(tp: Type)(implicit ctx: Context): Option[(List[Int], List[TypeBounds], Type)] = tp match { case app @ RefinedType(prefix, tpnme.hkApply) => - val cls = prefix.classSymbol + println(s"type lam $tp") + val cls = prefix.typeSymbol val variances = cls.typeParams.map(_.variance) val argBounds = prefix.argInfos.map(_.bounds) Some((variances, argBounds, app.refinedInfo)) |