julia> struct MyVec{a,A <: AbstractVector}
data::A
function MyVec{a,A}(data) where {a,A}
new(data)
end
end
julia> x = MyVec{:x, Vector}(rand(3))
MyVec{:x,Array{T,1} where T}([0.079421, 0.49293, 0.0557392])
How can I get the MyVec type from x? Currently I am using
I am sorry, I might not be clear in my question. I do not want a Core.TypeNameMyVec, I want a type MyVec. For example, if y is what I want. Then I can do
julia> y{:z, Vector}([1,2,3])
MyVec{:z,Array{T,1} where T}([1, 2, 3])