diff options
author | Martin Odersky <odersky@gmail.com> | 2011-07-28 13:50:21 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2011-07-28 13:50:21 +0000 |
commit | e0890be9a7bc74c3bdd38e26c60b11eb11a7a718 (patch) | |
tree | 6c147bbf967ae8814b54f92ef42dcfeaa052e383 /src/compiler/scala/reflect/internal/Types.scala | |
parent | ac96200c920a915736361b315ad65093b8014bbd (diff) | |
download | scala-e0890be9a7bc74c3bdd38e26c60b11eb11a7a718.tar.gz scala-e0890be9a7bc74c3bdd38e26c60b11eb11a7a718.tar.bz2 scala-e0890be9a7bc74c3bdd38e26c60b11eb11a7a718.zip |
Closes #4603. Review by extempore.
Diffstat (limited to 'src/compiler/scala/reflect/internal/Types.scala')
-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) } |