You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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>caseclassBox(x: String) { overridedeftoString=s"\n$x" }
// defined case class Box
Output
scala>Box("new line is lost")
valres0:Box=new line is lost
scala>Box("1 2 3\n1 2 3\n1 2 3")
valres1:Box=123123123
Expectation
Welcome to Scala2.13.4 (OpenJDK64-BitServerVM, Java11.0.10).
Type in expressions for evaluation. Ortry:help.
scala>caseclassBox(x: String) { overridedeftoString=s"\n$x" }
classBox
scala>Box("new line is NOT lost")
valres0:Box=new line is NOT lost
scala>Box("1 2 3\n1 2 3\n1 2 3")
valres1:Box=123123123