diff options
author | Martin Odersky <odersky@gmail.com> | 2013-10-27 16:05:07 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-10-27 16:05:07 +0100 |
commit | 1a83f5f653c6005bd3c207e1b6ab5bd57f6a9896 (patch) | |
tree | 319203151173ff6ed3c5b5a73a41c9713dbe4208 | |
parent | 961c0569eb0a54cf95363bab79add43da310984c (diff) | |
download | dotty-1a83f5f653c6005bd3c207e1b6ab5bd57f6a9896.tar.gz dotty-1a83f5f653c6005bd3c207e1b6ab5bd57f6a9896.tar.bz2 dotty-1a83f5f653c6005bd3c207e1b6ab5bd57f6a9896.zip |
Forcing less when determining the class symbol(s) of a type.
The previous scheme caused a CyclicReference when reading java.annotation.Documented.
-rw-r--r-- | src/dotty/tools/dotc/core/Types.scala | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index 8b116baa5..5f60454b5 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -239,6 +239,9 @@ object Types { final def classSymbol(implicit ctx: Context): Symbol = this match { case tp: ClassInfo => tp.cls + case tp: TypeRef => + val sym = tp.symbol + if (sym.isClass) sym else tp.underlying.classSymbol case tp: TypeProxy => tp.underlying.classSymbol case AndType(l, r) => @@ -262,6 +265,9 @@ object Types { final def classSymbols(implicit ctx: Context): List[ClassSymbol] = this match { case tp: ClassInfo => tp.cls :: Nil + case tp: TypeRef => + val sym = tp.symbol + if (sym.isClass) sym.asClass :: Nil else tp.underlying.classSymbols case tp: TypeProxy => tp.underlying.classSymbols case AndType(l, r) => |