Skip to content

Commit

Permalink
Declare Meta before using it in @intertypes
Browse files Browse the repository at this point in the history
The `@intertypes` macro assigns `mod.Meta` without declaring it.
This was accidentally allowed in Julia 1.9/1.10 due to a dropped
error check, but will likely be disallowed again in Julia 1.11.
See JuliaLang/julia#54678.

This just declares it `global` (which is what happened implicitly
on Julia 1.10/1.11). That said, you may want a `Const` instead,
in which case you would need a different fix.
  • Loading branch information
Keno committed Jun 6, 2024
1 parent a24aeea commit 359bcdd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/intertypes/julia.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ macro intertypes(file, modexpr)
end
_ => error("expected a module expression, got $modexpr")
end
push!(modexpr.args[3].args, :(global Meta))
imports = Expr(:vect, [:($(Expr(:quote, name)) => $name.Meta) for name in imports]...)
Expr(
:toplevel,
Expand Down

0 comments on commit 359bcdd

Please sign in to comment.