Skip to content

Conversation

@Keno
Copy link
Member

@Keno Keno commented Jan 22, 2025

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.

@Keno Keno force-pushed the kf/backdatedconstwarn branch 4 times, most recently from a95ff03 to 6f72123 Compare January 23, 2025 00:22
@Keno
Copy link
Member Author

Keno commented Jan 23, 2025

I think this should be good now. If Revise fails on CI, that's JuliaDebug/JuliaInterpreter.jl#657.

@Keno Keno force-pushed the kf/backdatedconstwarn branch 2 times, most recently from ee6a96f to 46091f9 Compare January 24, 2025 00:58
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.
@Keno Keno force-pushed the kf/backdatedconstwarn branch from 46091f9 to 99d7db6 Compare January 24, 2025 03:34
@Keno Keno merged commit 6cd750d into master Jan 25, 2025
7 checks passed
@Keno Keno deleted the kf/backdatedconstwarn branch January 25, 2025 02:50
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.
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