I have a composite type, MyType
,
struct MyType
a::Float64
b::Float64
end
When I do
a = MyType(1,2)
fieldnames(a)
I get an error
MethodError: no method matching fieldnames(::MyType)
When I do
fieldnames(MyType)
it returns
(:a,:b)
as expected. It was my understanding that the former should work as well - am I doing something wrong?