From bbae41749518d7f1f7c5b5b60569ec1a7c15acb4 Mon Sep 17 00:00:00 2001 From: Cody Tapscott <84105208+topolarity@users.noreply.github.com> Date: Mon, 13 May 2024 09:09:22 -0400 Subject: [PATCH] show: improve processed StackTrace check (#54381) This change is necessary for widely-typed vectors of stack traces to work correctly: ```julia Base.show_backtrace(stdout, convert(Vector{Any}, Base.stacktrace())) ``` which currently outputs a confusing error: ```julia 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)