Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -454,9 +454,10 @@ function show_function(io::IO, f::Function, compact::Bool)
elseif isdefined(mt, :module) && isdefined(mt.module, mt.name) &&
getfield(mt.module, mt.name) === f
if is_exported_from_stdlib(mt.name, mt.module) || mt.module === Main
print(io, mt.name)
show_sym(io, mt.name)
else
print(io, mt.module, ".", mt.name)
print(io, mt.module, ".")
show_sym(io, mt.name)
end
else
show_default(io, f)
Expand Down
4 changes: 4 additions & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,10 @@ end
# Hidden macro names
@test sprint(show, Expr(:macrocall, Symbol("@#"), nothing, :a)) == ":(@var\"#\" a)"

# PR #38418
module M1 var"#foo#"() = 2 end
@test occursin("M1.var\"#foo#\"", sprint(show, M1.var"#foo#", context = :module=>@__MODULE__))

# issue #12477
@test sprint(show, Union{Int64, Int32, Int16, Int8, Float64}) == "Union{Float64, Int16, Int32, Int64, Int8}"

Expand Down