diff --git a/src/EnumX.jl b/src/EnumX.jl index 8224166..f13b0d9 100644 --- a/src/EnumX.jl +++ b/src/EnumX.jl @@ -114,12 +114,12 @@ function Base.show(io::IO, ::MIME"text/plain", ::Base.Type{E}) where E <: Enum iob = IOBuffer() insts = Base.Enums.instances(E) n = length(insts) - stringmap = Dict{String, Int32}( + stringmap = Pair{String, Base.Enums.basetype(E)}[ string("$(nameof(parentmodule(E))).", k) => v for (k, v) in symbol_map(E) - ) - mx = maximum(textwidth, keys(stringmap); init = 0) + ] + mx = maximum(x -> textwidth(x.first), stringmap; init = 0) print(iob, - "Enum type $(nameof(parentmodule(E))).Type <: ", + "Enum type $(nameof(parentmodule(E))).$(nameof(E)) <: ", "Enum{$(Base.Enums.basetype(E))} with $(n) instance$(n == 1 ? "" : "s"):" ) for (k, v) in stringmap