Skip to content

Commit

Permalink
strengthen the inference barrier to show a Type (JuliaLang#39575)
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Feb 9, 2021
1 parent 53f44fe commit 340734f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 340734f

Please sign in to comment.