Skip to content

Commit

Permalink
Use Base's getindex in eval_user_input hack
Browse files Browse the repository at this point in the history
To avoid breakage when getindex is overwritten

(cherry picked from commit d09545b)
ref #13260
  • Loading branch information
simonster authored and tkelman committed Oct 3, 2015
1 parent 778c5d9 commit 3b45467
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function eval_user_input(ast::ANY, backend::REPLBackend)
ans = backend.ans
# note: value wrapped in a non-syntax value to avoid evaluating
# possibly-invalid syntax (issue #6763).
eval(Main, :(ans = $(Any[ans])[1]))
eval(Main, :(ans = $(getindex)($(Any[ans]), 1)))
backend.in_eval = true
value = eval(Main, ast)
backend.in_eval = false
Expand Down

0 comments on commit 3b45467

Please sign in to comment.