Skip to content

Commit

Permalink
Support two-argument version of Core.include (#863)
Browse files Browse the repository at this point in the history
`Core.include` does not support mapexpr, so the existing error was
wrong. It does however suppoer the two-argument version with module
(which we did support for `Base.include`), so wire that up appropriately.
  • Loading branch information
Keno authored Nov 14, 2024
1 parent d22e731 commit 30fd127
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lowered.jl
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,10 @@ function methods_by_execution!(@nospecialize(recurse), methodinfo, docexprs, fra
# path management and parsing new expressions
if length(stmt.args) == 2
add_includes!(methodinfo, mod, @lookup(frame, stmt.args[2]))
elseif length(stmt.args) == 3
add_includes!(methodinfo, @lookup(frame, stmt.args[2]), @lookup(frame, stmt.args[3]))
else
error("include(mapexpr, path) is not supported") # TODO (issue #634)
error("Bad call to Core.include")
end
assign_this!(frame, nothing) # FIXME: the file might return something different from `nothing`
pc = next_or_nothing!(frame)
Expand All @@ -469,7 +471,7 @@ function methods_by_execution!(@nospecialize(recurse), methodinfo, docexprs, fra
if isa(mod_or_mapexpr, Module)
add_includes!(methodinfo, mod_or_mapexpr, @lookup(frame, stmt.args[3]))
else
error("include(mapexpr, path) is not supported")
error("include(mapexpr, path) is not supported") # TODO (issue #634)
end
end
assign_this!(frame, nothing) # FIXME: the file might return something different from `nothing`
Expand Down

0 comments on commit 30fd127

Please sign in to comment.