In Julia (<0.6), when creating a parametric composite type, such as MyType{T}, is there a clean way to recover Tfrom an instance of this type?
Take an example from the document:
type Point{T}
x::T
y::T
end
I can create an object p = Point(5.0,5.0), Tit will correspond here Float64so that the corresponding object is Point{Float64}. Is there a clean way to recover Float64here?
I could do
typeof(p.x)
But it seems like it is not.
source
share