Skip to content

Commit 9d8ecaa

Browse files
authored
Add docstring for inference barrier. (#54844)
`compilerbarrier` actually has a great docstring. But it's most common form is via `inferencebarrier` which had none.
1 parent 3de5e5d commit 9d8ecaa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

base/essentials.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,6 +1081,12 @@ function invoke_in_world(world::UInt, @nospecialize(f), @nospecialize args...; k
10811081
return Core._call_in_world(world, Core.kwcall, kwargs, f, args...)
10821082
end
10831083

1084+
"""
1085+
inferencebarrier(x)
1086+
1087+
A shorthand for `compilerbarrier(:type, x)` causes the type of this statement to be inferred as `Any`.
1088+
See [`Base.compilerbarrier`](@ref) for more info.
1089+
"""
10841090
inferencebarrier(@nospecialize(x)) = compilerbarrier(:type, x)
10851091

10861092
"""

0 commit comments

Comments
 (0)