From cba51a3ad2cd811c3b98d462775dc9dda4b7ce6e Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Fri, 27 Jan 2023 10:37:46 +1300 Subject: [PATCH] fix dislplay of empty named tuples to close #846 --- src/show.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/show.jl b/src/show.jl index 5b3a5dad..a1ebb945 100644 --- a/src/show.jl +++ b/src/show.jl @@ -1,5 +1,3 @@ -## REGISTERING LABELS OF OBJECTS DURING ASSIGNMENT - """ color_on() @@ -20,6 +18,8 @@ macro colon(p) Expr(:quote, p) end +## REGISTERING LABELS OF OBJECTS DURING ASSIGNMENT + """ @constant x = value @@ -70,8 +70,9 @@ end # long version of showing a named tuple: Base.show(stream::IO, ::MIME"text/plain", t::NamedTuple) = fancy_nt(stream, t) -fancy_nt(t) = fancy_nt(stdout, t) -fancy_nt(stream::IO, t) = fancy_nt(stream, t, 0) +fancy_nt(t) = fancy_nt(stdout, t) # is this used? +fancy_nt(stream, t::NamedTuple{(), Tuple{}}) = print(stream, "NamedTuple()") +fancy_nt(stream, t) = fancy_nt(stream, t, 0) fancy_nt(stream, t, n) = show(stream, t) function fancy_nt(stream, t::NamedTuple, n) print(stream, "(")