julia> import Base.show
julia> show(io::IO, ::MIME{Symbol("text/plain")}, c::Char) = show(io, c)
show (generic function with 296 methods)
julia> 'a'
'a'
but if I want to have possibility to switch it on I need to remember old functionality. This doesn’t work:
julia> oldfnc(io::IO, m::MIME{Symbol("text/plain")}, c::Char) = show(io, m, c);
julia> oldfnc(stdout, MIME{Symbol("text/plain")}(), 'a')
'a': ASCII/Unicode U+0061 (category Ll: Letter, lowercase)
julia> import Base.show
julia> show(io::IO, ::MIME{Symbol("text/plain")}, c::Char) = show(io, c)
show (generic function with 296 methods)
julia> oldfnc(stdout, MIME{Symbol("text/plain")}(), 'a')
'a'
this naive experiment doesn’t work either
julia> mm = collect(methods(show, [IO, MIME{Symbol("text/plain")}, Char]))[1]
show(io::IO, ::MIME{Symbol("text/plain")}, c::T) where T<:AbstractChar in Base at char.jl:281
julia> mm('a')
ERROR: MethodError: objects of type Method are not callable
| | |_| | | | (_| | | Version 1.1.0-DEV.542 (2018-10-25)
_/ |\__'_|_|_|\__'_| | Commit 36e21d47b5 (21 days old master)
julia> using Revise; using Rebugger
julia> m = @which show(stdout, MIME("text/plain"), 'a')
show(io::IO, ::MIME{Symbol("text/plain")}, c::T) where T<:AbstractChar in Base at char.jl:292
julia> ex = Revise.get_def(m)
[ Info: tracking Base
ERROR: KeyError: key "/home/lapeyre/.local/julias/julia-1.1.0-DEV.542/share/julia/base/char.jl" not found
Stacktrace:
[1] getindex at ./dict.jl:478 [inlined]
[2] macro expansion at ./logging.jl:313 [inlined]
[3] #get_def#53(::Set{String}, ::Function, ::Method) at /home/lapeyre/.julia/packages/Revise/xO23U/src/Revise.jl:628
[4] get_def(::Method) at /home/lapeyre/.julia/packages/Revise/xO23U/src/Revise.jl:606
[5] top-level scope at none:0
Seems like a path issue; I haven’t had anyone report one of those in a while. Please open a Revise issue and report your findings while following these tips.