From 1a83f5f653c6005bd3c207e1b6ab5bd57f6a9896 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 27 Oct 2013 16:05:07 +0100 Subject: Forcing less when determining the class symbol(s) of a type. The previous scheme caused a CyclicReference when reading java.annotation.Documented. --- src/dotty/tools/dotc/core/Types.scala | 6 ++++++ 1 file changed, 6 insertions(+) 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) => -- cgit v1.2.3