How do I set bounds for a parametric subtype of a parametric abstract type?

Yeah this part of Julia syntax is sometimes tricky for me in remembering how to specify the parametric type’s bounds.

I also see your choice of a name for your subtype suggests your level of frustration :sweat_smile: in fact you’re not alone in this frustration.

As in thread I linked, the working syntax is

abstract type Dummy{T} end

struct EstoTieneSentido{T <: Real} <: Dummy{T}
    a::Float64
    b::T
end
2 Likes