From 04de4b58b75cb526506317db02d8b6b2a8aefd99 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Mon, 5 Sep 2016 18:01:12 +0200 Subject: Fix problems handling types in Inliner 1. Don't generate local aliases - we can potentially run into avoidance problems later for such aliases 2. Scan all parts of leaf types for things that need to be registered cor remappings. --- src/dotty/tools/dotc/core/Types.scala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (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 30d1c0136..7a64e19c8 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -228,8 +228,8 @@ object Types { !existsPart(!p(_)) /** Performs operation on all parts of this type */ - final def foreachPart(p: Type => Unit)(implicit ctx: Context): Unit = - new ForeachAccumulator(p).apply((), this) + final def foreachPart(p: Type => Unit, stopAtStatic: Boolean = false)(implicit ctx: Context): Unit = + new ForeachAccumulator(p, stopAtStatic).apply((), this) /** The parts of this type which are type or term refs */ final def namedParts(implicit ctx: Context): collection.Set[NamedType] = @@ -3704,8 +3704,7 @@ object Types { x || p(tp) || (forceLazy || !tp.isInstanceOf[LazyRef]) && foldOver(x, tp) } - class ForeachAccumulator(p: Type => Unit)(implicit ctx: Context) extends TypeAccumulator[Unit] { - override def stopAtStatic = false + class ForeachAccumulator(p: Type => Unit, override val stopAtStatic: Boolean)(implicit ctx: Context) extends TypeAccumulator[Unit] { def apply(x: Unit, tp: Type): Unit = foldOver(p(tp), tp) } -- cgit v1.2.3