Skip to content

Commit b0ac014

Browse files
committed
Fixes #12998 - Crash when calling Compiler.newRun() without a docCtx
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 b0ac014

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)