You are overloading display in order to customize output. This is the wrong way to do it — see the manual on custom pretty printing.
To customize REPL output, you should override Base.show(io::IO, x::MyType) and/or Base.show(io::IO, ::MIME"text/plain", x::MyType), as explained in the manual.
Overriding display directly will break IJulia, Juno, and other environments that have a custom display mechanism.
You are overloading
displayin order to customize output. This is the wrong way to do it — see the manual on custom pretty printing.To customize REPL output, you should override
Base.show(io::IO, x::MyType)and/orBase.show(io::IO, ::MIME"text/plain", x::MyType), as explained in the manual.Overriding
displaydirectly will break IJulia, Juno, and other environments that have a customdisplaymechanism.