diff options
-rw-r--r-- | src/compiler/scala/reflect/internal/Types.scala | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/reflect/internal/Types.scala b/src/compiler/scala/reflect/internal/Types.scala index 2c626013b3..c34d285d9e 100644 --- a/src/compiler/scala/reflect/internal/Types.scala +++ b/src/compiler/scala/reflect/internal/Types.scala @@ -3471,6 +3471,7 @@ A type's typeSymbol should never be inspected directly. */ object rawToExistential extends TypeMap { private var expanded = immutable.Set[Symbol]() + private var generated = immutable.Set[Type]() def apply(tp: Type): Type = tp match { case TypeRef(pre, sym, List()) if isRawIfWithoutArgs(sym) => if (expanded contains sym) AnyRefClass.tpe @@ -3481,8 +3482,10 @@ A type's typeSymbol should never be inspected directly. } finally { expanded -= sym } - case ExistentialType(_, _) => // stop to avoid infinite expansions - tp + case ExistentialType(_, _) if !(generated contains tp) => // to avoid infinite expansions. todo: not sure whether this is needed + val result = mapOver(tp) + generated += result + result case _ => mapOver(tp) } |