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/jvm/src/dotty/tools/dottydoc/model/factories.scala | |
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/jvm/src/dotty/tools/dottydoc/model/factories.scala')
-rw-r--r-- | dottydoc/jvm/src/dotty/tools/dottydoc/model/factories.scala | 18 |
1 files changed, 15 insertions, 3 deletions
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 { |