diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-08-07 17:04:12 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-08-19 15:37:33 +0200 |
commit | 20fda579d76690cc86a1f0a5c9e703fa4a94cb47 (patch) | |
tree | 41913fa0430b7b6a579ba75efa37fb9de774d499 /dottydoc | |
parent | 5fdc353794e1175a3967a7df10e5d80c443a5754 (diff) | |
download | dotty-20fda579d76690cc86a1f0a5c9e703fa4a94cb47.tar.gz dotty-20fda579d76690cc86a1f0a5c9e703fa4a94cb47.tar.bz2 dotty-20fda579d76690cc86a1f0a5c9e703fa4a94cb47.zip |
Fix type params of classes, traits defs, which broke after new HK scheme
Diffstat (limited to 'dottydoc')
-rw-r--r-- | dottydoc/js/src/model/entities.scala | 4 | ||||
-rw-r--r-- | dottydoc/jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala | 4 | ||||
-rw-r--r-- | dottydoc/jvm/src/dotty/tools/dottydoc/model/factories.scala | 18 |
3 files changed, 19 insertions, 7 deletions
diff --git a/dottydoc/js/src/model/entities.scala b/dottydoc/js/src/model/entities.scala index 49d0ec005..4180ad431 100644 --- a/dottydoc/js/src/model/entities.scala +++ b/dottydoc/js/src/model/entities.scala @@ -61,13 +61,13 @@ trait SuperTypes extends sjs.Object { trait Package extends Entity with Members @ScalaJSDefined -trait Class extends Entity with Members with Modifiers +trait Class extends Entity with Members with Modifiers with TypeParams @ScalaJSDefined trait CaseClass extends Class @ScalaJSDefined -trait Object extends Class +trait Object extends Entity with Members with Modifiers @ScalaJSDefined trait Trait extends Class diff --git a/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala b/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala index d9fb3bacc..013010971 100644 --- a/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala +++ b/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala @@ -39,10 +39,10 @@ class DocASTPhase extends Phase { def collect(tree: Tree, prev: List[String] = Nil)(implicit ctx: Context): Entity = track(tree.symbol, ctx) { val implicitConversions = ctx.docbase.defs(tree.symbol) - def collectList(xs: List[Tree], ps: List[String])(implicit ctx: Context): List[Entity] = + def collectList(xs: List[Tree], ps: List[String]): List[Entity] = xs.map(collect(_, ps)).filter(_ != NonEntity) - def collectEntityMembers(xs: List[Tree], ps: List[String])(implicit ctx: Context) = + def collectEntityMembers(xs: List[Tree], ps: List[String]) = collectList(xs, ps).asInstanceOf[List[Entity with Members]] def collectMembers(tree: Tree, ps: List[String] = prev)(implicit ctx: Context): List[Entity] = { diff --git a/dottydoc/jvm/src/dotty/tools/dottydoc/model/factories.scala b/dottydoc/jvm/src/dotty/tools/dottydoc/model/factories.scala index 929d42d4f..dae8442e8 100644 --- a/dottydoc/jvm/src/dotty/tools/dottydoc/model/factories.scala +++ b/dottydoc/jvm/src/dotty/tools/dottydoc/model/factories.scala @@ -112,10 +112,22 @@ object factories { } def typeParams(sym: Symbol)(implicit ctx: Context): List[String] = - sym.denot.info match { - case pt: PolyType => + sym.info match { + case pt: PolyType => // TODO: not sure if this case is needed anymore pt.paramNames.map(_.show.split("\\$").last) - case _ => Nil + case ClassInfo(_, _, _, decls, _) => + decls.iterator + .filter(_.flags is Flags.TypeParam) + .map { tp => + val prefix = + if (tp.flags is Flags.Covariant) "+" + else if (tp.flags is Flags.Contravariant) "-" + else "" + prefix + tp.name.show.split("\\$").last + } + .toList + case _ => + Nil } def paramLists(tpe: Type)(implicit ctx: Context): List[ParamList] = tpe match { |