ResultTypes.jl
ResultTypes.jl copied to clipboard
avoid specializing `convert` for `Any` result types
Specializing convert(Result{Any, E}, x)
for every type of x
can incur substantial compilation overhead (not only on convert
but also on Some
). This change avoids specializing in case of explicit Any
result type.
This is analogous to Julia Base where we have
convert(::Type{Any}, Core.@nospecialize x) = x
to avoid excessive specialization.