Here is the docstring for fieldtypes
:
fieldtypes(T::Type)
The declared types of all fields in a composite DataType T as a tuple.
Examples
≡≡≡≡≡≡≡≡≡≡
julia> struct Foo
x::Int64
y::String
end
julia> fieldtypes(Foo)
(Int64, String)
As far as I can tell, this only seems to address composite types defined with the struct
keyword. However, it so happens that fieldtypes
performs a useful operation on a Tuple{...}
type:
julia> fieldtypes(Tuple{Int, String})
(Int64, String)
It doesn’t seem like this behavior is really covered by the current docstring. So, my question is, is the behavior of fieldtypes
when applied to a Tuple{...}
type considered public API that we can rely on?