diff --git a/src/ExceptionUnwrapping.jl b/src/ExceptionUnwrapping.jl index c7e8ba4..c946d78 100644 --- a/src/ExceptionUnwrapping.jl +++ b/src/ExceptionUnwrapping.jl @@ -104,6 +104,9 @@ struct UnwrappedExceptionNotFound{RequestedType, ExceptionType} <: Base.Exceptio end UnwrappedExceptionNotFound{R}(e::E) where {R,E} = UnwrappedExceptionNotFound{R,E}(e) +# We have confirmed via Cthulhu and the Allocations profiler that these seem to correctly +# not be specializing, and not allocating. +@nospecialize # Base case is that e -> e unwrap_exception(e) = e @@ -115,10 +118,6 @@ unwrap_exception(e::Base.CapturedException) = e.ex has_wrapped_exception(::T, ::Type{T}) where T = true -# We have confirmed via Cthulhu and the Allocations profiler that these seem to correctly -# not be specializing, and not allocating. -@nospecialize - # Types don't match, do the unrolling, but prevent inference since this happens at runtime # and only during exception catch blocks, and might have arbitrarily nested types. And in # practice, we've seen julia's inference really struggles here.