summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2010-09-28 15:46:36 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2010-09-28 15:46:36 +0000
commit9058008d344442e181b852b65e81da18af0fa800 (patch)
tree26c3d622dd264430d6fcd7f7ffeaab67d5d0d6be
parentcb91343d2b02b038f6c297ba79a052e0758caae8 (diff)
downloadscala-9058008d344442e181b852b65e81da18af0fa800.tar.gz
scala-9058008d344442e181b852b65e81da18af0fa800.tar.bz2
scala-9058008d344442e181b852b65e81da18af0fa800.zip
closes #3865: scaladoc now prints anonymous typ...
closes #3865: scaladoc now prints anonymous type functions since they may occur due to normalization of type constructor arguments of inferred types review by dubochet
-rw-r--r--src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
index edb6ba3491..14f5263313 100644
--- a/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
+++ b/src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala
@@ -406,7 +406,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { thisFactory
else if (bSym.isAliasType)
Some(new NonTemplateMemberImpl(bSym, inTpl) with HigherKindedImpl with AliasType {
override def isAliasType = true
- def alias = makeType(appliedType(sym.tpe, sym.info.typeParams map {_.tpe}).normalize, inTpl, sym)
+ def alias = makeType(sym.tpe.dealias, inTpl, sym)
})
else if (bSym.isPackage)
inTpl match { case inPkg: PackageImpl => makePackage(bSym, inPkg) }
@@ -540,8 +540,14 @@ class ModelFactory(val global: Global, val settings: doc.Settings) { thisFactory
nameBuffer append " {...}" // TODO: actually print the refinement
}
/* Polymorphic types */
- case PolyType(tparams, result) if (!tparams.isEmpty) =>
- throw new Error("Polymorphic type '" + tpe + "' cannot be printed as a type")
+ case PolyType(tparams, result) if tparams nonEmpty =>
+// throw new Error("Polymorphic type '" + tpe + "' cannot be printed as a type")
+ def typeParamsToString(tps: List[Symbol]): String = if(tps isEmpty) "" else
+ tps.map{tparam =>
+ tparam.varianceString + tparam.name + typeParamsToString(tparam.typeParams)
+ }.mkString("[", ", ", "]")
+ nameBuffer append typeParamsToString(tparams)
+ appendType0(result)
case PolyType(tparams, result) if (tparams.isEmpty) =>
nameBuffer append '⇒'
appendType0(result)