From 340734f9fc24cbe103a81fcf35d05a61915b89ce Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Tue, 9 Feb 2021 14:59:46 -0500 Subject: [PATCH] strengthen the inference barrier to show a Type (#39575) --- base/show.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/base/show.jl b/base/show.jl index a971293bfa850..734b194f7cabb 100644 --- a/base/show.jl +++ b/base/show.jl @@ -396,7 +396,7 @@ show_default(io::IO, @nospecialize(x)) = _show_default(io, inferencebarrier(x)) function _show_default(io::IO, @nospecialize(x)) t = typeof(x) - show(io, inferencebarrier(t)) + show(io, inferencebarrier(t)::DataType) print(io, '(') nf = nfields(x) nb = sizeof(x)::Int @@ -814,7 +814,8 @@ function show(io::IO, ::MIME"text/plain", @nospecialize(x::Type)) end end -function show(io::IO, @nospecialize(x::Type)) +show(io::IO, @nospecialize(x::Type)) = _show_type(io, inferencebarrier(x)) +function _show_type(io::IO, @nospecialize(x::Type)) if print_without_params(x) show_type_name(io, unwrap_unionall(x).name) return