How to find to which module a type belongs to?


Hi fellows,

Let’s assume, I have a type XYZ which i currently use in my current module , however XYZ is defined in some other module. How can i get to which module XYZ belongs to?


julia> get_module(name) = eval(parse(string(name)[1:findlast(string(name), '.')-1]))
get_module (generic function with 1 method)

julia> using StaticArrays

julia> get_module(SArray)

Edit: see below for proper way!

julia> using StaticArrays

julia> @which SArray