File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
compiler/src/dotty/tools/repl Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,17 @@ class ReplDriver(settings: Array[String],
187187 // TODO: i5069
188188 final def bind (name : String , value : Any )(using state : State ): State = state
189189
190+ /**
191+ * Controls whether the `System.out` and `System.err` streams are set to the provided constructor parameter instance
192+ * of [[java.io.PrintStream ]] during the execution of the repl. On by default.
193+ *
194+ * Disabling this can be beneficial when executing a repl instance inside a concurrent environment, for example a
195+ * thread pool (such as the Scala compile server in the Scala Plugin for IntelliJ IDEA).
196+ *
197+ * In such environments, indepently executing `System.setOut` and `System.setErr` without any synchronization can
198+ * lead to unpredictable results when restoring the original streams (dependent on the order of execution), leaving
199+ * the Java process in an inconsistent state.
200+ */
190201 protected def redirectOutput : Boolean = true
191202
192203 // redirecting the output allows us to test `println` in scripted tests
You can’t perform that action at this time.
0 commit comments