bpart: Give a warning when accessing a backdated const binding#57133
Merged
bpart: Give a warning when accessing a backdated const binding#57133
Conversation
a95ff03 to
6f72123
Compare
Member
Author
|
I think this should be good now. If Revise fails on CI, that's JuliaDebug/JuliaInterpreter.jl#657. |
ee6a96f to
46091f9
Compare
This implements the strategy proposed in #57102 (comment). Example: ``` julia> function foo(i) eval(:(const x = $i)) x end foo (generic function with 1 method) julia> foo(1) WARNING: Detected access to binding Main.x in a world prior to its definition world. Julia 1.12 has introduced more strict world age semantics for global bindings. !!! This code may malfunction under Revise. !!! This code will error in future versions of Julia. Hint: Add an appropriate `invokelatest` around the access to this binding. 1 ``` The warning is triggered once per binding to avoid spamming for repeated access.
46091f9 to
99d7db6
Compare
topolarity
added a commit
to topolarity/Documenter.jl
that referenced
this pull request
Feb 10, 2025
Starting in Julia 1.12, global bindings have strict world-age semantics so this change is required to avoid the warning introduced by JuliaLang/julia#57133
topolarity
added a commit
to topolarity/Documenter.jl
that referenced
this pull request
Feb 10, 2025
Starting in Julia 1.12, global bindings have strict world-age semantics so this change is required to avoid the warning introduced by JuliaLang/julia#57133
mortenpi
pushed a commit
to JuliaDocs/Documenter.jl
that referenced
this pull request
Feb 11, 2025
Starting in Julia 1.12, global bindings have strict world-age semantics so this change is required to avoid the warning introduced by JuliaLang/julia#57133
serenity4
pushed a commit
to serenity4/julia
that referenced
this pull request
May 1, 2025
…Lang#57133) This implements the strategy proposed in JuliaLang#57102 (comment). Example: ``` julia> function foo(i) eval(:(const x = $i)) x end foo (generic function with 1 method) julia> foo(1) WARNING: Detected access to binding Main.x in a world prior to its definition world. Julia 1.12 has introduced more strict world age semantics for global bindings. !!! This code may malfunction under Revise. !!! This code will error in future versions of Julia. Hint: Add an appropriate `invokelatest` around the access to this binding. 1 ``` The warning is triggered once per binding to avoid spamming for repeated access.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements the strategy proposed in #57102 (comment). Example:
The warning is triggered once per binding to avoid spamming for repeated access.