bug icon indicating copy to clipboard operation
bug copied to clipboard

Old REPL output breaks pasting transcript

Open som-snytt opened this issue 3 years ago • 0 comments

reproduction steps

Welcome to Scala 2.13.8 (OpenJDK 64-Bit Server VM, Java 17.0.1).
Type in expressions for evaluation. Or try :help.

scala> scala> (new Array[Unit](5))(0) == ()

// Detected repl transcript. Paste more, or ctrl-D to finish.

<console>:10: warning: comparing values of types Unit and Unit using `==' will always yield true
     |        (new Array[Unit](5))(0) == ()
     |                                ^
     | res16: Boolean = false
     |
     | scala> (new Array[Unit](5))(0) == null
     | <console>:10: warning: comparing values of types Unit and Null using `==' will always yield false
     |        (new Array[Unit](5))(0) == null
     |                                ^
     | res17: Boolean = true
     |
     | scala> {val a = Array.fill(5)(()); a(0) == ()}
     |
     |

problem

It doesn't detect the scala prompt and ignores ctl-d. Maybe the old <console> label is the problem?

Sample from https://github.com/scala/bug/issues/4572

som-snytt avatar Feb 05 '22 21:02 som-snytt