Skip to content

Commit 7b10d5f

Browse files
authored
add back wordaround for Slot objects should not occur in an AST in Ipython mode (#47878)
1 parent c8a0521 commit 7b10d5f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

stdlib/REPL/src/REPL.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,9 +1404,9 @@ end
14041404

14051405
function out_transform(@nospecialize(x), n::Ref{Int})
14061406
return quote
1407-
let x = $x
1408-
$capture_result($n, x)
1409-
x
1407+
let __temp_val_a72df459 = $x
1408+
$capture_result($n, __temp_val_a72df459)
1409+
__temp_val_a72df459
14101410
end
14111411
end
14121412
end

stdlib/REPL/test/repl.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,6 +1641,10 @@ fake_repl() do stdin_write, stdout_read, repl
16411641
s = sendrepl2("REPL\n", "In [10]")
16421642
@test contains(s, "Out[9]: REPL")
16431643

1644+
# Test for https://github.com/JuliaLang/julia/issues/46451
1645+
s = sendrepl2("x_47878 = range(-1; stop = 1)\n", "-1:1")
1646+
@test contains(s, "Out[11]: -1:1")
1647+
16441648
write(stdin_write, '\x04')
16451649
Base.wait(repltask)
16461650
end

0 commit comments

Comments
 (0)