From 5b4f154c9e4c2c6ff48ac68b8d984e306853328f Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 21 Mar 2013 21:30:30 +0100 Subject: More fixes to classfile reading. Can now read all classes in scala.collection.generic. Some failures remain for their companion objects. --- src/dotty/tools/dotc/core/Types.scala | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Types.scala') diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 252901b17..b061a1227 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -551,7 +551,13 @@ object Types { } def hkRefinement(tp: TypeRef): Type = { - val hkArgs = hkApp(tp.info).typeArgs + val hkArgs = + if (tp.symbol.isCompleting) + // This can happen if a higher-kinded type appears applied to arguments in its own bounds. + // TODO: Catch this case and mark as "proceed at own risk" later. + args map (_ => defn.InvariantBetweenClass.typeConstructor) + else + hkApp(tp.info).typeArgs ((tp: Type) /: hkArgs.zipWithIndex.zip(args)) { case (parent, ((hkArg, idx), arg)) => val vsym = hkArg.typeSymbol @@ -1627,6 +1633,10 @@ object Types { name.isTermName && (pre member name).hasAltWith(_ is Deferred) } + object takeAllFilter extends NameFilter { + def apply(pre: Type, name: Name)(implicit ctx: Context): Boolean = true + } + // ----- Exceptions ------------------------------------------------------------- class TypeError(msg: String) extends Exception(msg) -- cgit v1.2.3