Skip to content
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
2 changes: 1 addition & 1 deletion stdlib/REPL/src/REPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ function modules_to_be_loaded(ast::Expr, mods::Vector{Symbol} = Symbol[])
arg isa Expr && modules_to_be_loaded(arg, mods)
end
filter!(mod -> !in(String(mod), ["Base", "Main", "Core"]), mods) # Exclude special non-package modules
return mods
return unique(mods)
end

"""
Expand Down
2 changes: 2 additions & 0 deletions stdlib/REPL/test/repl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,8 @@ end
@test mods == [:Foo, :Bar]
mods = REPL.modules_to_be_loaded(Base.parse_input_line("import Foo, Bar"))
@test mods == [:Foo, :Bar]
mods = REPL.modules_to_be_loaded(Base.parse_input_line("using Foo.bar, Foo.baz"))
@test mods == [:Foo]

mods = REPL.modules_to_be_loaded(Base.parse_input_line("if false using Foo end"))
@test mods == [:Foo]
Expand Down