summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-28 18:32:15 +0000
committerPaul Phillips <paulp@improving.org>2011-07-28 18:32:15 +0000
commit4c4da544a072574fce7becb8400951418a8a9e76 (patch)
treea3f8b6ec4a489a5ac5111a9b2ffc1b286ecdfc17
parent07066970b3cb4b37bb8b0aebf4c979c9ba4c2db4 (diff)
downloadscala-4c4da544a072574fce7becb8400951418a8a9e76.tar.gz
scala-4c4da544a072574fce7becb8400951418a8a9e76.tar.bz2
scala-4c4da544a072574fce7becb8400951418a8a9e76.zip
Closes #4603. Review by extempore.
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index a490e0272a..90ba03e2eb 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -3361,6 +3361,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
@@ -3371,8 +3372,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)
}