Skip to content

Commit 7e3c706

Browse files
authored
Check input expresion in numbered prompt (#50064)
1 parent e025877 commit 7e3c706

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

stdlib/REPL/src/REPL.jl

+1
Original file line numberDiff line numberDiff line change
@@ -1418,6 +1418,7 @@ function out_transform(@nospecialize(x), n::Ref{Int})
14181418
end
14191419

14201420
function get_usings!(usings, ex)
1421+
ex isa Expr || return usings
14211422
# get all `using` and `import` statements which are at the top level
14221423
for (i, arg) in enumerate(ex.args)
14231424
if Base.isexpr(arg, :toplevel)

stdlib/REPL/test/repl.jl

+4
Original file line numberDiff line numberDiff line change
@@ -1652,6 +1652,10 @@ fake_repl() do stdin_write, stdout_read, repl
16521652
@test !contains(s, "ERROR")
16531653
@test contains(s, "Test Passed")
16541654

1655+
# Test for https://github.com/JuliaLang/julia/issues/49319
1656+
s = sendrepl2("# comment", "In [16]")
1657+
@test !contains(s, "ERROR")
1658+
16551659
write(stdin_write, '\x04')
16561660
Base.wait(repltask)
16571661
end

0 commit comments

Comments
 (0)