Skip to content

Commit

Permalink
invokelatest docs should say not exported before 1.9 (#50341)
Browse files Browse the repository at this point in the history
(cherry picked from commit cb6d0f2)
  • Loading branch information
stevengj authored and KristofferC committed Aug 10, 2023
1 parent f0ade8a commit 15f417f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,9 @@ e.g. long-running event loops or callback functions that may
call obsolete versions of a function `f`.
(The drawback is that `invokelatest` is somewhat slower than calling
`f` directly, and the type of the result cannot be inferred by the compiler.)
!!! compat "Julia 1.9"
Prior to Julia 1.9, this function was not exported, and was called as `Base.invokelatest`.
"""
function invokelatest(@nospecialize(f), @nospecialize args...; kwargs...)
kwargs = merge(NamedTuple(), kwargs)
Expand Down
5 changes: 4 additions & 1 deletion base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1913,12 +1913,15 @@ end
"""
@invokelatest f(args...; kwargs...)
Provides a convenient way to call [`Base.invokelatest`](@ref).
Provides a convenient way to call [`invokelatest`](@ref).
`@invokelatest f(args...; kwargs...)` will simply be expanded into
`Base.invokelatest(f, args...; kwargs...)`.
!!! compat "Julia 1.7"
This macro requires Julia 1.7 or later.
!!! compat "Julia 1.9"
Prior to Julia 1.9, this macro was not exported, and was called as `Base.@invokelatest`.
"""
macro invokelatest(ex)
f, args, kwargs = destructure_callex(ex)
Expand Down

0 comments on commit 15f417f

Please sign in to comment.