Skip to content

Commit 720ca20

Browse files
committed
Simplify Driver.setup
1 parent f434fc7 commit 720ca20

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

compiler/src/dotty/tools/dotc/Driver.scala

+4-6
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,11 @@ class Driver extends DotClass {
5252
}
5353

5454
def setup(args: Array[String], rootCtx: Context): (List[String], Context) = {
55-
val ctx0 = rootCtx.fresh
56-
val summary = CompilerCommand.distill(args)(ctx0)
57-
ctx0.setSettings(summary.sstate)
55+
val ctx = rootCtx.fresh
56+
val summary = CompilerCommand.distill(args)(ctx)
57+
ctx.setSettings(summary.sstate)
5858

59-
val ctx =
60-
if (shouldAddDocContext(ctx0)) ctx0.setProperty(ContextDoc, new ContextDocstrings)
61-
else ctx0
59+
if (shouldAddDocContext(ctx)) ctx.setProperty(ContextDoc, new ContextDocstrings)
6260

6361
val fileNames = CompilerCommand.checkUsage(summary, sourcesRequired)(ctx)
6462
(fileNames, ctx)

0 commit comments

Comments
 (0)