From 00ea4fc5f46ebc984ac68a463b3a87d553a2c2f4 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Sat, 16 Jul 2016 15:51:53 +0200 Subject: Rebase dottydoc over new HK scheme --- .../jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala | 2 +- .../src/dotty/tools/dottydoc/core/DocImplicitsPhase.scala | 2 +- .../main/scala/dotty/tools/dottydoc/model/factories.scala | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'dottydoc') diff --git a/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala b/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala index 72e679565..a2d440e8c 100644 --- a/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala +++ b/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocASTPhase.scala @@ -56,7 +56,7 @@ class DocASTPhase extends Phase { } def addedFromSymbol(sym: Symbol): List[Entity] = { - val defs = sym.info.membersBasedOnFlags(Flags.Method, Flags.Synthetic | Flags.Private).map { meth => + val defs = sym.info.bounds.hi.membersBasedOnFlags(Flags.Method, Flags.Synthetic | Flags.Private).map { meth => track(meth.symbol, ctx) { DefImpl(meth.symbol.name.decode.toString, Nil, path(meth.symbol), returnType(meth.info), typeParams(meth.symbol), paramLists(meth.info)) } diff --git a/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocImplicitsPhase.scala b/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocImplicitsPhase.scala index 084764856..5d53d6397 100644 --- a/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocImplicitsPhase.scala +++ b/dottydoc/jvm/src/dotty/tools/dottydoc/core/DocImplicitsPhase.scala @@ -18,7 +18,7 @@ class DocImplicitsPhase extends MiniPhaseTransform { thisTransformer => tree.vparamss.length > 0 && tree.vparamss(0).length == 1 // should only take one arg, since it has to be a transformation ) { - val convertee = tree.vparamss(0)(0).symbol.info.widenDealias.finalResultType.typeSymbol//denot.typeRef // the pimped type (i.e. `class`) + val convertee = tree.vparamss(0)(0).symbol.info.widenDealias.finalResultType.typeSymbol // the pimped type (i.e. `class`) ctx.base.addDef(convertee, tree.symbol.info.widenDealias.finalResultType.typeSymbol) } diff --git a/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala b/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala index 72e52a96f..ef4854979 100644 --- a/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala +++ b/dottydoc/shared/src/main/scala/dotty/tools/dottydoc/model/factories.scala @@ -55,8 +55,8 @@ object factories { } def expandTpe(t: Type, params: List[MaterializableLink] = Nil): Reference = t match { - case ref @ RefinedType(parent, rn) => { - val paramName = (ref.refinedInfo match { + case ref @ RefinedType(parent, rn, info) => { + val paramName = (info match { case ta: TypeAlias if ta.alias.isInstanceOf[NamedType] => ta.alias.asInstanceOf[NamedType].name.show case _ => rn.show @@ -64,6 +64,15 @@ object factories { val param = UnsetLink(paramName, paramName) expandTpe(parent, param :: params) } + case HKApply(tycon, args) => + def paramName: Type => String = { tpe => + (tpe match { + case ta: TypeAlias if ta.alias.isInstanceOf[NamedType] => + ta.alias.asInstanceOf[NamedType].name.show + case _ => tpe.show + }).split("\\$").last + } + expandTpe(tycon, args.map(paramName).map(x => UnsetLink(x,x))) case TypeRef(_, n) => val name = n.decode.toString.split("\\$").last typeRef(name, params = params) @@ -118,7 +127,7 @@ object factories { case annot: AnnotatedType => paramLists(annot.tpe) case (_: PolyParam | _: RefinedType | _: TypeRef | _: ThisType | - _: ExprType | _: OrType | _: AndType) => Nil // return types should not be in the paramlist + _: ExprType | _: OrType | _: AndType | _: HKApply) => Nil // return types should not be in the paramlist } def superTypes(t: Tree)(implicit ctx: Context): List[MaterializableLink] = t.symbol.denot match { -- cgit v1.2.3