Consider the following:
abstract A
type B <: A end
type C <: A end
Base.show(io::IO, ::MIME"text/plain", ::Type{A}) = print(io, "I'm abstract type A")
Base.show{T<:A}(io::IO, ::MIME"text/plain", ::Type{T}) = print(io, "I'm type $T, a subtype of A")
The first show method is not called for A
:
julia> B
I'm type B, a subtype of A
julia> A
I'm type A, a subtype of A
Is it possible to dispatch separately for A
and B
?