From 4ecb3b6e771a96c8c9be04f48f24feed0e2cadfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Mon, 12 Jan 2026 18:38:41 +0100 Subject: [PATCH] Fix JET warnings in `show(::IOBuffer, ::StackFrame)` --- base/stacktraces.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/base/stacktraces.jl b/base/stacktraces.jl index 0e807adb92839..522db86acd226 100644 --- a/base/stacktraces.jl +++ b/base/stacktraces.jl @@ -285,7 +285,8 @@ function show_spec_linfo(io::IO, frame::StackFrame) else # Equivalent to the default implementation of `show_custom_spec_sig` # for `linfo isa CodeInstance`, but saves an extra dynamic dispatch. - show_spec_sig(io, def, frame_mi(frame).specTypes) + mi = frame_mi(frame)::MethodInstance + show_spec_sig(io, def::Method, mi.specTypes) end else m = linfo::Method @@ -297,7 +298,8 @@ end # Can be extended by compiler packages to customize backtrace display of custom code instance frames function show_custom_spec_sig(io::IO, @nospecialize(owner), linfo::CodeInstance, frame::StackFrame) mi = Base.get_ci_mi(linfo) - return show_spec_sig(io, mi.def, mi.specTypes) + m = mi.def::Method # the case ::Module is handled in show_spec_linfo + return show_spec_sig(io, m, mi.specTypes) end function show_spec_sig(io::IO, m::Method, @nospecialize(sig::Type))