Skip to content

Commit

Permalink
Add docstring for inference barrier. (#54844)
Browse files Browse the repository at this point in the history
`compilerbarrier` actually has a great docstring.
But it's most common form is via `inferencebarrier` which had none.
  • Loading branch information
oxinabox committed Jun 21, 2024
1 parent 3de5e5d commit 9d8ecaa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,12 @@ function invoke_in_world(world::UInt, @nospecialize(f), @nospecialize args...; k
return Core._call_in_world(world, Core.kwcall, kwargs, f, args...)
end

"""
inferencebarrier(x)
A shorthand for `compilerbarrier(:type, x)` causes the type of this statement to be inferred as `Any`.
See [`Base.compilerbarrier`](@ref) for more info.
"""
inferencebarrier(@nospecialize(x)) = compilerbarrier(:type, x)

"""
Expand Down

0 comments on commit 9d8ecaa

Please sign in to comment.