Can @pure functions throw an error?

question

#1

MWE, is this OK?

Base.@pure function key_in(key::Symbol, keys::Tuple{Vararg{Symbol}})
    for k in keys
        key ≡ k && return true
    end
    false
end

Base.@pure function remove_key(key::Symbol, keys::Tuple{Vararg{Symbol}})
    kept = Symbol[]
    key_in(key, keys) || error("Cannot drop $key which is not in $keys")
    for k in keys
        k ≡ key || push!(kept, k)
    end
    (kept..., )
end

remove_key(:a, (:a, :b, :c)) # (:b, :c)
remove_key(:a, (:b, :c))     # throws error