Skip to content

Commit 2f4ca43

Browse files
committed
Issue #12998 ctx.docCtx.get -> ctx.docCtx.foreach
Changes based on suggestion in the issue and the implementation currently seen here: https://github.com/lampepfl/dotty/blob/79fae194b80e136a243e7c7f949268166d169e1e/compiler/src/dotty/tools/dotc/typer/Namer.scala#L449
1 parent 147e9ba commit 2f4ca43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/Definitions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1781,7 +1781,7 @@ class Definitions {
17811781
}
17821782

17831783
def addSyntheticSymbolsComments(using Context): Unit =
1784-
def add(sym: Symbol, doc: String) = ctx.docCtx.get.addDocstring(sym, Some(Comment(NoSpan, doc)))
1784+
def add(sym: Symbol, doc: String) = ctx.docCtx.foreach(_.addDocstring(sym, Some(Comment(NoSpan, doc))))
17851785

17861786
add(AnyClass,
17871787
"""/** Class `Any` is the root of the Scala class hierarchy. Every class in a Scala

0 commit comments

Comments
 (0)