From 30fd1275f76e0e4d4863b481097da147b8a641f8 Mon Sep 17 00:00:00 2001 From: Keno Fischer Date: Thu, 14 Nov 2024 14:58:50 -0500 Subject: [PATCH] Support two-argument version of Core.include (#863) `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. --- src/lowered.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lowered.jl b/src/lowered.jl index bbf78eeb..3e5ccc88 100644 --- a/src/lowered.jl +++ b/src/lowered.jl @@ -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) @@ -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`