From 22f517d5808d884d6454e336ae57917264dd2241 Mon Sep 17 00:00:00 2001 From: Cody Tapscott Date: Sun, 5 May 2024 12:28:01 -0400 Subject: [PATCH] show: improve processed stacktrace check This change is necessary for widely-typed vectors of stack traces to work correctly: ``` Base.show_backtrace(stdout, convert(Vector{Any}, Base.stacktrace())) ``` which currently outputs a confusing error: ``` Stacktrace: ERROR: MethodError: no method matching iterate(::Base.StackTraces.StackFrame) ... ``` --- base/errorshow.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/errorshow.jl b/base/errorshow.jl index b06052433ffc4..567339c668600 100644 --- a/base/errorshow.jl +++ b/base/errorshow.jl @@ -800,7 +800,7 @@ function show_backtrace(io::IO, t::Vector) end # t is a pre-processed backtrace (ref #12856) - if t isa Vector{Any} + if t isa Vector{Any} && (length(t) == 0 || t[1] isa Tuple{StackFrame,Int}) filtered = t else filtered = process_backtrace(t)