Skip to content

Commit

Permalink
Check if newmod is module in splot_expressions! (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfitzseb authored Feb 13, 2020
1 parent d874384 commit df596af
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/construct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ function split_expressions!(modexs, docexprs, lex::Expr, mod::Module, ex::Expr;
newname = ex.args[2]::Symbol
if isdefined(mod, newname)
newmod = getfield(mod, newname)
newmod isa Module || throw(ErrorException("invalid redefinition of constant $(newname)"))
else
if (id = Base.identify_package(mod, String(newname))) !== nothing && haskey(Base.loaded_modules, id)
newmod = Base.root_module(id)
Expand Down

0 comments on commit df596af

Please sign in to comment.