diff --git a/stdlib/REPL/src/REPL.jl b/stdlib/REPL/src/REPL.jl index 4c83cdf33508d..9c8712e0d41fc 100644 --- a/stdlib/REPL/src/REPL.jl +++ b/stdlib/REPL/src/REPL.jl @@ -1404,9 +1404,9 @@ end function out_transform(@nospecialize(x), n::Ref{Int}) return quote - let x = $x - $capture_result($n, x) - x + let __temp_val_a72df459 = $x + $capture_result($n, __temp_val_a72df459) + __temp_val_a72df459 end end end diff --git a/stdlib/REPL/test/repl.jl b/stdlib/REPL/test/repl.jl index ab25a56510262..edcb91defc9ab 100644 --- a/stdlib/REPL/test/repl.jl +++ b/stdlib/REPL/test/repl.jl @@ -1641,6 +1641,10 @@ fake_repl() do stdin_write, stdout_read, repl s = sendrepl2("REPL\n", "In [10]") @test contains(s, "Out[9]: REPL") + # Test for https://github.com/JuliaLang/julia/issues/46451 + s = sendrepl2("x_47878 = range(-1; stop = 1)\n", "-1:1") + @test contains(s, "Out[11]: -1:1") + write(stdin_write, '\x04') Base.wait(repltask) end