Skip to content

Commit 49f5726

Browse files
committed
.
1 parent 2e7fef6 commit 49f5726

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

compiler/src/dotty/tools/repl/ReplDriver.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ class ReplDriver(settings: Array[String],
122122
final def initialState: State =
123123
val emptyState = State(0, 0, Map.empty, Set.empty, false, rootCtx)
124124
val initScript = rootCtx.settings.replInitScript.value(using rootCtx)
125-
initScript.trim() match
126-
case "" => emptyState
127-
case script => run(script)(using emptyState)
125+
val pprintImport = "import dotty.shaded.pprint.pprintln"
126+
val combinedScript = initScript.trim() match
127+
case "" => pprintImport
128+
case script => s"$pprintImport\n$script"
129+
run(combinedScript)(using emptyState)
128130

129131
/** Reset state of repl to the initial state
130132
*

0 commit comments

Comments
 (0)