Skip to content

Commit 603883c

Browse files
committed
Cook doc comments at most once
Doc comments that have already been cooked don't need to be cooked again, and shouldn't be cooked again, because this would introduce duplicate symbols.
1 parent 96f1e81 commit 603883c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/typer/Docstrings.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ trait Docstrings { self: Typer =>
1717
*/
1818
def cookComments(syms: List[Symbol], owner: Symbol)(implicit ctx: Context): Unit =
1919
ctx.docCtx.foreach { docbase =>
20-
val relevantSyms = syms.filter(docbase.docstring(_).isDefined)
20+
val relevantSyms = syms.filter(docbase.docstring(_).exists(!_.isExpanded))
2121
relevantSyms.foreach { sym =>
2222
expandParentDocs(sym)
2323
val usecases = docbase.docstring(sym).map(_.usecases).getOrElse(Nil)

0 commit comments

Comments
 (0)