Let's say that I have a type such as
type SuperType
x::Float64
end
and let's say that I want to create a subtype of the above non-abstract base SuperType, such as
type SubType <: SuperType
y::Float64
end
I know that the operator <: is erroneously used above, I only used it in order to explain what I want to achieve. I want SybType to have two data members, its own y and the (inherited) data member x of SuperType. The problem is that <: is used only with abstract types and for boolean operations as far as my undrestanding goes.
The only alternative I can think of is to use the Union type; is this a possibility? If so, I would be grateful if anyone could give me an example.
Also, how initialization of x can occur from the constructor of SybType in the above example? Perhaps I am thinking in a C++ way, and I should start thinking more in Julia syntax directly.
Thanks a lot for the help!