diff --git a/base/show.jl b/base/show.jl index cea973f1bef34a..b901eab5906ed8 100644 --- a/base/show.jl +++ b/base/show.jl @@ -1253,8 +1253,6 @@ show(io::IO, n::Signed) = (write(io, string(n)); nothing) show(io::IO, n::Unsigned) = print(io, "0x", string(n, pad = sizeof(n)<<1, base = 16)) print(io::IO, n::Unsigned) = print(io, string(n)) -show(io::IO, p::Ptr) = print(io, typeof(p), " @0x$(string(UInt(p), base = 16, pad = Sys.WORD_SIZE>>2))") - has_tight_type(p::Pair) = typeof(p.first) == typeof(p).parameters[1] && typeof(p.second) == typeof(p).parameters[2] diff --git a/test/show.jl b/test/show.jl index d9bf282af131ac..63663152d9d91c 100644 --- a/test/show.jl +++ b/test/show.jl @@ -1291,7 +1291,7 @@ end repr == "Union{String, $(curmod_prefix)M30442.T}" end let repr = sprint(dump, Ptr{UInt8}(UInt(1))) - @test repr == "Ptr{UInt8} @$(Base.repr(UInt(1)))\n" + @test repr == "Ptr{UInt8}($(Base.repr(UInt(1))))\n" end let repr = sprint(dump, Core.svec()) @test repr == "empty SimpleVector\n" @@ -2695,6 +2695,10 @@ let lowered = Meta.lower(Main, Expr(:let, Expr(:block), Expr(:block, Expr(:tople @test contains(sprint(show, ci), "_1 = 1") end +# Pointers should be reprable +@test is_juliarepr(pointer([1])) +@test is_juliarepr(Ptr{Vector{Complex{Float16}}}(UInt(0xdeadbeef))) + # Toplevel MethodInstance with undef :uninferred let topmi = ccall(:jl_new_method_instance_uninit, Ref{Core.MethodInstance}, ()); topmi.specTypes = Tuple{}