Skip to content

Commit ca8147d

Browse files
committed
Fix and reinstate repl/errmsgs
1 parent 0125b46 commit ca8147d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package dotty.tools.repl
22

3-
import java.io.{File => JFile, PrintStream, PrintWriter}
3+
import java.io.{BufferedWriter, File => JFile, OutputStreamWriter, PrintStream, PrintWriter}
44
import java.nio.charset.StandardCharsets
55

66
import dotty.tools.dotc.ast.Trees._
@@ -428,7 +428,7 @@ class ReplDriver(settings: Array[String],
428428
/** Like ConsoleReporter, but without file paths or real -Xprompt'ing */
429429
private object ReplConsoleReporter extends ConsoleReporter(
430430
reader = null, // this short-circuits the -Xprompt display from waiting for an input
431-
writer = new PrintWriter(out, /* autoFlush = */ true), // write to out, not Console.err
431+
writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8)), /* autoFlush = */ true), // write to out, not Console.err
432432
) {
433433
override def posFileStr(pos: SourcePosition) = "" // omit file paths
434434
}

compiler/test-resources/pending/repl/errmsgs renamed to compiler/test-resources/repl/errmsgs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,19 @@ scala> abstract class C { type T; val x: T; val s: Unit = { type T = String; var
5151
1 | abstract class C { type T; val x: T; val s: Unit = { type T = String; var y: T = x; locally { def f() = { type T = Int; val z: T = y }; f() } }; }
5252
| ^
5353
|Found: (C.this.x : C.this.T)
54-
|Required: T?
54+
|Required: T²
5555
|
5656
|where: T is a type in class C
57-
| T? is a type in the initializer of value s which is an alias of String
57+
| T² is a type in the initializer of value s which is an alias of String
5858
longer explanation available when compiling with `-explain`
5959
-- [E007] Type Mismatch Error: -------------------------------------------------
6060
1 | abstract class C { type T; val x: T; val s: Unit = { type T = String; var y: T = x; locally { def f() = { type T = Int; val z: T = y }; f() } }; }
6161
| ^
6262
|Found: (y : T)
63-
|Required: T?
63+
|Required: T²
6464
|
6565
|where: T is a type in the initializer of value s which is an alias of String
66-
| T? is a type in method f which is an alias of Int
66+
| T² is a type in method f which is an alias of Int
6767
longer explanation available when compiling with `-explain`
6868
2 errors found
6969
scala> class Foo() { def bar: Int = 1 }; val foo = new Foo(); foo.barr

0 commit comments

Comments
 (0)