ResultTypes.jl icon indicating copy to clipboard operation
ResultTypes.jl copied to clipboard

avoid specializing `convert` for `Any` result types

Open stev47 opened this issue 1 year ago • 0 comments

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.

stev47 avatar Aug 04 '23 09:08 stev47