Closed
Description
Compiler version
3.0.0-RC2-bin-20210227-07d9dd2-NIGHTLY
Minimized code
The Scala 3 REPL trim all string values before echoing, which means that leading whitespace newline is lost and multi-line strings will get first line miss-aligned etc.
scala> case class Box(x: String) { override def toString = s"\n$x" }
// defined case class Box
Output
scala> Box("new line is lost")
val res0: Box = new line is lost
scala> Box("1 2 3\n1 2 3\n1 2 3")
val res1: Box = 1 2 3
1 2 3
1 2 3
Expectation
Welcome to Scala 2.13.4 (OpenJDK 64-Bit Server VM, Java 11.0.10).
Type in expressions for evaluation. Or try :help.
scala> case class Box(x: String) { override def toString = s"\n$x" }
class Box
scala> Box("new line is NOT lost")
val res0: Box =
new line is NOT lost
scala> Box("1 2 3\n1 2 3\n1 2 3")
val res1: Box =
1 2 3
1 2 3
1 2 3