Skip to content

add back wordaround for Slot objects should not occur in an AST in Ipython mode #47878

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment on lines +1407 to 1410
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, I had toyed with making capture_result return the value too, so that it could be written as:

Suggested change
let __temp_val_a72df459 = $x
$capture_result($n, __temp_val_a72df459)
__temp_val_a72df459
end
$capture_result($n, $x)

end
end
Expand Down
4 changes: 4 additions & 0 deletions stdlib/REPL/test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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