scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
230 stars 21 forks source link

REPL replay produces conflicting method #12790

Open som-snytt opened 1 year ago

som-snytt commented 1 year ago

Reproduction steps

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

scala> def f = 42
def f: Int

scala> def f = 27
def f: Int

scala> :replay
replay> def f = 42
def f: Int

replay> def f = 27
        def f = 27
            ^
On line 2: error: method f is defined twice;
          the conflicting method f was defined at line 1:5

scala>

Problem

I expected each line of transcript to be "interpreted" just like the first time.