diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2006-03-22 14:10:57 +0000 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2006-03-22 14:10:57 +0000 |
commit | 0140bb0b4aad4b090d36348d0bcdac14dbee5ec5 (patch) | |
tree | fb79d0bef17e25d111ab22f091aef9f99e884da9 | |
parent | e5864c02f0b620ef80b9eabe0259c72fa2fcdd65 (diff) | |
download | scala-0140bb0b4aad4b090d36348d0bcdac14dbee5ec5.tar.gz scala-0140bb0b4aad4b090d36348d0bcdac14dbee5ec5.tar.bz2 scala-0140bb0b4aad4b090d36348d0bcdac14dbee5ec5.zip |
Quick hack so that polymorphic types are printe...
Quick hack so that polymorphic types are printed properly (not just
their symbol).
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/DocGenerator.scala | 11 |
1 files changed, 10 insertions, 1 deletions
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()); |