@ -1,6 +1,6 @@
name = "EnumX"
uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56"
version = "1.0.0"
version = "1.0.1"
[compat]
julia = "1.6"
@ -138,7 +138,11 @@ function Base.show(io::IO, ::MIME"text/plain", x::E) where E <: Enum
write(io, seekstart(iob))
return nothing
end
function Base.show(io::IO, ::MIME"text/plain", ::Base.Type{E}) where E <: Enum
function Base.show(io::IO, ::MIME"text/plain", ::Type{E}) where E <: Enum
if !isconcretetype(E) # handle EnumX.Enum and EnumX.Enum{T}
invoke(show, Tuple{IO, Type}, io, E)
return
iob = IOBuffer()
insts = Base.Enums.instances(E)
n = length(insts)
@ -71,6 +71,12 @@ let io = IOBuffer()
show(io, "text/plain", Fruit.Banana)
str = String(take!(io))
@test str == "Fruit.Banana = 1"
show(io, "text/plain", EnumX.Enum)
@test str == "EnumX.Enum"
show(io, "text/plain", EnumX.Enum{Int32})
@test str == "EnumX.Enum{Int32}"