Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macroexpand on Julia 1.11 #3000

Merged
merged 1 commit into from
Aug 15, 2024
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 src/evaluation/MacroAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function resolve_topology(
sn = (session, notebook)

function macroexpand_cell(cell)
try_macroexpand(module_name::Symbol=Symbol("")) = begin
function try_macroexpand(module_name::Symbol=Symbol(""))
success, result = macroexpand_in_workspace(sn, unresolved_topology.codes[cell].parsedcode, cell.cell_id, module_name)
if success
Success(result)
Expand Down
6 changes: 4 additions & 2 deletions src/evaluation/WorkspaceManager.jl
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,10 @@ function macroexpand_in_workspace(session_notebook::SN, macrocall, cell_id, modu
# We have to be careful here, for example a thrown `MethodError()` will contain the called method and arguments.
# which normally would be very useful for debugging, but we can't serialize it!
# So we make sure we only serialize the exception we know about, and string-ify the others.
if (error isa LoadError && error.error isa UndefVarError) || error isa UndefVarError
(false, error)
if error isa UndefVarError
(false, UndefVarError(error.var))
elseif error isa LoadError && error.error isa UndefVarError
(false, UndefVarError(error.error.var))
else
(false, ErrorException(sprint(showerror, error)))
end
Expand Down
Loading