Skip to content

Use invokelatest for resolution#185

Open
asinghvi17 wants to merge 1 commit intoJuliaDocs:masterfrom
asinghvi17:as/julia-1.12-world-age-fix
Open

Use invokelatest for resolution#185
asinghvi17 wants to merge 1 commit intoJuliaDocs:masterfrom
asinghvi17:as/julia-1.12-world-age-fix

Conversation

@asinghvi17
Copy link
Copy Markdown

Julia 1.12 introduced binding partitions (JuliaLang/julia#57133, #57150, #57253) which enforce strict world-age semantics for global bindings. When DocStringExtensions performs method resolution during docstring formatting, the calls happen in a stale world age and fail to find matching methods. This is the same pattern that Julia's own doc system (JuliaLang/julia#57349) and Documenter.jl (JuliaDocs/Documenter.jl#2624) adopted for 1.12 compatibility.

Changes:

  • Wrap all Docs.resolve() calls with Base.invokelatest
  • Wrap methods() calls in getmethods!() with Base.invokelatest
  • Wrap Base.return_types() call with Base.invokelatest
  • Add nothing guard on findfirst/findlast result in TypedMethodSignatures to prevent ArgumentError when no matching tuple is found
  • Add world-age safety tests exercising all abbreviation types via Base.invokelatest to simulate the stale world-age scenario

This PR was made with the help of Claude.

…mpatibility

Julia 1.12 introduced binding partitions (JuliaLang/julia#57133, #57150,
#57253) which enforce strict world-age semantics for global bindings.
When DocStringExtensions performs method resolution during docstring
formatting, the calls happen in a stale world age and fail to find
matching methods. This is the same pattern that Julia's own doc system
(JuliaLang/julia#57349) and Documenter.jl (JuliaDocs/Documenter.jl#2624)
adopted for 1.12 compatibility.

Changes:
- Wrap all Docs.resolve() calls with Base.invokelatest
- Wrap methods() calls in getmethods!() with Base.invokelatest
- Wrap Base.return_types() call with Base.invokelatest
- Add nothing guard on findfirst/findlast result in TypedMethodSignatures
  to prevent ArgumentError when no matching tuple is found
- Add world-age safety tests exercising all abbreviation types via
  Base.invokelatest to simulate the stale world-age scenario

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@asinghvi17 asinghvi17 marked this pull request as ready for review April 9, 2026 11:12
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