Skip to content

Commit f7abd32

Browse files
Merge pull request #13794 from dotty-staging/scaladoc/known-subtypes-fix
Scaladoc: Fix missing known subtypes
2 parents 7e06899 + 8163be4 commit f7abd32

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

scaladoc/src/dotty/tools/scaladoc/tasty/ClassLikeSupport.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,10 @@ trait ClassLikeSupport:
292292
def getParentsAsTreeSymbolTuples: List[(Tree, Symbol)] =
293293
for
294294
parentTree <- c.parents if isValidPos(parentTree.pos) // We assume here that order is correct
295-
parentSymbol = if parentTree.symbol.isClassConstructor then parentTree.symbol.owner else parentTree.symbol
295+
parentSymbol = parentTree match
296+
case t: TypeTree => t.tpe.typeSymbol
297+
case tree if tree.symbol.isClassConstructor => tree.symbol.owner
298+
case tree => tree.symbol
296299
if parentSymbol != defn.ObjectClass && parentSymbol != defn.AnyClass
297300
yield (parentTree, parentSymbol)
298301

scaladoc/src/dotty/tools/scaladoc/transformers/InheritanceInformationTransformer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package transformers
33

44
class InheritanceInformationTransformer(using DocContext) extends (Module => Module):
55
override def apply(original: Module): Module =
6-
val subtypes = getSupertypes(original.rootPackage).groupBy(_._1).transform((k, v) => v.map(_._2))
6+
val subtypes = getSupertypes(original.rootPackage).groupMap(_(0))(_(1))
77
original.updateMembers { m =>
88
val edges = getEdges(m.asLink.copy(kind = bareClasslikeKind(m.kind)), subtypes)
99
val st: Seq[LinkToType] = edges.map(_._1).distinct

0 commit comments

Comments
 (0)