From 7574e0245dd1a82c1798980b1f879493fb4ac683 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Mon, 12 Dec 2022 16:16:04 +0100 Subject: [PATCH] add back wordaround for `Slot objects should not occur in an AST` in Ipython mode --- stdlib/REPL/src/REPL.jl | 6 +++--- stdlib/REPL/test/repl.jl | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) 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..16d7d4174a1e7 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 = range(-1; stop = 1)\n", "-1:1") + @test contains(s, "Out[11]: -1:1") + write(stdin_write, '\x04') Base.wait(repltask) end