From 0140bb0b4aad4b090d36348d0bcdac14dbee5ec5 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Wed, 22 Mar 2006 14:10:57 +0000 Subject: Quick hack so that polymorphic types are printe... Quick hack so that polymorphic types are printed properly (not just their symbol). --- src/compiler/scala/tools/nsc/doc/DocGenerator.scala | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/compiler/scala/tools/nsc/doc/DocGenerator.scala b/src/compiler/scala/tools/nsc/doc/DocGenerator.scala index c467f222d4..0fd794098b 100644 --- a/src/compiler/scala/tools/nsc/doc/DocGenerator.scala +++ b/src/compiler/scala/tools/nsc/doc/DocGenerator.scala @@ -63,6 +63,15 @@ abstract class DocGenerator extends Models { Text(sym.toString()) } + def urlFor(tpe: Type, target: String): NodeSeq = try { + if (tpe.symbol.sourceFile == null) Text(tpe.toString()); + else aref(urlFor(tpe.symbol), target, tpe.toString()); + } catch { + case e : Error => + //System.err.println("SYM=" + sym); + Text(tpe.symbol.toString()) + } + def urlFor0(sym : Symbol, orig : Symbol) : String = { (if (sym == NoSymbol) { "XXX"; @@ -286,7 +295,7 @@ abstract class DocGenerator extends Models { case tree : AbsTypeDef => ifT(tree.lo, Text(" <: "), false). concat(Text(tree.symbol.nameString)).concat(ifT(tree.hi, Text(" <: "), true)); - case tpt : TypeTree => urlFor(tpt.tpe.symbol, contentFrame); + case tpt : TypeTree => urlFor(tpt.tpe, contentFrame); case id : Ident => Text("YY: " + id.symbol.nameString); case EmptyTree => NodeSeq.Empty; case _ => Text("XX=" + tree.getClass() + " " + tree.toString()); -- cgit v1.2.3