When you subtype AbstractFloat, it's going to try to use the `grisu.jl`
code to do the showing. The grisu code has all sorts of requirements to
work, most of it semi-hard-coded for Float16, Float32, and Float64. Your
best bet would probably be to define

Base.show(io::IO, x::SubtypeAbsFloat) = show(io, x.val)

On Mon, Aug 24, 2015 at 8:56 PM, Jeffrey Sarnoff <[email protected]>
wrote:

> julia> immutable SubtypeReal <: Real
>            val::Float64
>        end
>
> julia> a=SubtypeReal(5.0)
> SubtypeReal(5.0)
>
> julia> immutable SubtypeAbsFloat <: AbstractFloat
>            val::Float64
>        end
>
> julia> a=SubtypeAbsFloat(5.0)
> Error showing value of type SubtypeAbsFloat:
> ERROR: - not defined for SubtypeAbsFloat
>  in _show at grisu.jl:64
>  in show at grisu.jl:119
>  ...
>  in run_repl at ./REPL.jl:166
>  in _start at ./client.jl:453
>
> Defining show for it does not help.
>
>

Reply via email to