Skip to content

REPL does not report all values #12626

Open
@som-snytt

Description

@som-snytt

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 scala/scala3#15764 (comment) to great embarrassment and consternation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions