Skip to content

docs: fix-up world-age handling for META access #57349

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 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions base/docs/Docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ const META = gensym(:meta)
const METAType = IdDict{Any,Any}

function meta(m::Module; autoinit::Bool=true)
if !isdefinedglobal(m, META)
return autoinit ? invokelatest(initmeta, m) : nothing
if !invokelatest(isdefinedglobal, m, META)
return autoinit ? initmeta(m) : nothing
end
# TODO: This `invokelatest` is not technically required, but because
# of the automatic constant backdating is currently required to avoid
Expand All @@ -85,13 +85,13 @@ function meta(m::Module; autoinit::Bool=true)
end

function initmeta(m::Module)
if !isdefinedglobal(m, META)
if !invokelatest(isdefinedglobal, m, META)
val = METAType()
Core.eval(m, :(const $META = $val))
push!(modules, m)
return val
end
return getglobal(m, META)
return invokelatest(getglobal, m, META)
end

function signature!(tv::Vector{Any}, expr::Expr)
Expand Down
2 changes: 1 addition & 1 deletion test/testhelpers/OffsetDenseArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function Base.setindex(x::OffsetDenseArray, v, i::Integer)
x.x[i - x.offset] = v
end

IndexStyle(::Type{<:OffsetDenseArray}) = Base.IndexLinear()
Base.IndexStyle(::Type{<:OffsetDenseArray}) = Base.IndexLinear()
Base.axes(x::OffsetDenseArray) = (x.offset + 1 : x.offset + length(x.x),)
Base.keys(x::OffsetDenseArray) = only(axes(x))

Expand Down