Skip to content

Don't reevaluate at__MODULE__ #133

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

Merged
merged 5 commits into from
Feb 18, 2025

Conversation

serenity4
Copy link
Contributor

I realized that #131 does not actually fix the issue on nightly (and was tricked into believing it did by a faulty setup 🤦). The issue is caused by this behavior:

julia> let; global mod = Module()
           println(isdefined(mod, Symbol("@xx")))
           Core.eval(mod, :(macro xx() end))
           println(isdefined(mod, Symbol("@xx")))
       end
false
true

julia> isdefined(mod, Symbol("@xx"))
true

julia> let; global mod = Module()
           println(isdefined(mod, Symbol("@__MODULE__")))
           Core.eval(mod, :(macro __MODULE__() end))
           println(isdefined(mod, Symbol("@__MODULE__")))
       end
false # <- this used to return `true` on 1.11
false

julia> isdefined(mod, Symbol("@__MODULE__"))
true

which I believe was introduced by JuliaLang/julia#57253. Invoking isdefined with invokelatest gives the correct answer.

This is a simple temporary fix, but perhaps this should be fixed upstream. cc @Keno

@pfitzseb pfitzseb merged commit 0dbab5b into JuliaDebug:master Feb 18, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants