bug icon indicating copy to clipboard operation
bug copied to clipboard

REPL does not report all values

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

Reproduction steps

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

scala> class C(var c: Int) ; class D(c: Int) extends C(c) { def f = c }
class C
class D

scala> val d = new D(42); d.f; d.c = 27; d.f
val d: D = D@6f5d0190
// mutated d.c
val res0: Int = 42

Problem

There are two invocations d.f but only one value is printed. (Scala 3 REPL prints both.)

Noticed at https://github.com/lampepfl/dotty/issues/15764#issuecomment-1196261156 to great embarrassment and consternation.

som-snytt avatar Jul 27 '22 04:07 som-snytt