From 56bb49217b0283c25be90203982e059417e24486 Mon Sep 17 00:00:00 2001 From: Nicholas Lawrence Date: Sat, 4 Nov 2023 14:12:57 -0500 Subject: [PATCH 1/2] version message is written to stdout, not err --- compiler/src/dotty/tools/dotc/config/CliCommand.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/config/CliCommand.scala b/compiler/src/dotty/tools/dotc/config/CliCommand.scala index 914df040fbf7..ce61a7d6c1fc 100644 --- a/compiler/src/dotty/tools/dotc/config/CliCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CliCommand.scala @@ -3,6 +3,8 @@ package config import scala.language.unsafeNulls +import dotty.tools.dotc.reporting.{ConsoleReporter} +import java.io.{ BufferedReader, PrintWriter } import Settings._ import core.Contexts._ import printing.Highlighting @@ -130,7 +132,8 @@ trait CliCommand: report.echo(ifErrorsMsg) None else if settings.version.value then - report.echo(versionMsg) + // ctx defaults to Console.err + ConsoleReporter(writer = new PrintWriter(Console.out, true)).printMessage(versionMsg) None else if isHelpFlag then report.echo(helpMsg) From 8b34bcf62e376f7304ff53a77b35dbced7a31dee Mon Sep 17 00:00:00 2001 From: Nick Lawrence Date: Mon, 6 Nov 2023 09:38:21 -0600 Subject: [PATCH 2/2] pr review - remove redundant {} on import Co-authored-by: Nicolas Stucki --- compiler/src/dotty/tools/dotc/config/CliCommand.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/config/CliCommand.scala b/compiler/src/dotty/tools/dotc/config/CliCommand.scala index ce61a7d6c1fc..e64ca10cc058 100644 --- a/compiler/src/dotty/tools/dotc/config/CliCommand.scala +++ b/compiler/src/dotty/tools/dotc/config/CliCommand.scala @@ -3,7 +3,7 @@ package config import scala.language.unsafeNulls -import dotty.tools.dotc.reporting.{ConsoleReporter} +import dotty.tools.dotc.reporting.ConsoleReporter import java.io.{ BufferedReader, PrintWriter } import Settings._ import core.Contexts._