Skip to content

Commit f9c9421

Browse files
authored
Merge pull request #13013 from GavinRay97/patch-1
Crash when calling Compiler.newRun() without a docCtx
2 parents e7eb856 + b0ac014 commit f9c9421

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)