What’s the trick for getting the docstring of the function stored in a composite type’s field?
type MyType
f::Function
end
julia> s = MyType(sin)
MyType(sin)
julia> s.f
sin (generic function with 10 methods)
julia> @doc sin
sin(x)
Compute sine of x, where x is in radians.
julia> @doc(s.f)
ERROR: MethodError: no method matching Base.Docs.Binding(::MyType, ::Symbol)
Closest candidates are:
Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:12
julia> @doc s.f
ERROR: MethodError: no method matching Base.Docs.Binding(::MyType, ::Symbol)
Closest candidates are:
Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:12
julia> @doc (s.f)
ERROR: MethodError: no method matching Base.Docs.Binding(::MyType, ::Symbol)
Closest candidates are:
Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:12