E.g. something like
julia> @inline _isassigned(A::Array{Float64}, inds...) = (@boundscheck checkbounds(Bool, A, inds...); true)
_isassigned (generic function with 1 method)
julia> @code_typed (A -> @inbounds _isassigned(A, 1))(ones(2))
CodeInfo(
1 ─ return true
) => Bool
This does not need a foreign call. Are there cases that I’ve not thought about?