Skip to content

Commit

Permalink
add back wordaround for Slot objects should not occur in an AST in …
Browse files Browse the repository at this point in the history
…Ipython mode (#47878)
  • Loading branch information
KristofferC authored Dec 14, 2022
1 parent c8a0521 commit 7b10d5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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
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")

This comment has been minimized.

Copy link
@vtjnash

vtjnash Dec 14, 2022

Member

Won't this fail to make the test meaningful, since you are specifically testing what happens if exactly x gets assigned a value here?

This comment has been minimized.

Copy link
@vtjnash

vtjnash Dec 14, 2022

Member
    s = sendrepl2("__temp_val_a72df459 = range(-1; stop = 1)\n", "-1:1")

This comment has been minimized.

Copy link
@KristofferC

KristofferC Dec 14, 2022

Author Member

Hm, that's a good point but I think the suggestion here will fail in the same way as it did with the x. It is just unlikely to happen with user code now.

@test contains(s, "Out[11]: -1:1")

write(stdin_write, '\x04')
Base.wait(repltask)
end

0 comments on commit 7b10d5f

Please sign in to comment.