Documenting Fields of Parametric Type
From Discourse
Trying to get the documentation for Bar.x works, but not Foo.x or Foo{Float64}.x:
# file tmp4.jl
"""
This is struct Foo
"""
struct Foo{T}
"""
This is field x
"""
x
end
"""
This is struct Bar
"""
struct Bar
"""
This is field x
"""
x
end
In the repl:
julia> include("tmp4.jl")
Bar
help?> Foo
search: floor pointer_from_objref OverflowError RoundFromZero FileMonitor functionloc StackOverflowError
This is struct Foo
help?> Foo{Float64}.x
ERROR: MethodError: no method matching Base.Docs.Binding(::Type{Foo{Float64}}, ::Symbol)
Closest candidates are:
Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:12
help?> Foo.x
ERROR: MethodError: no method matching Base.Docs.Binding(::Type{Foo}, ::Symbol)
Closest candidates are:
Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:12
help?> Bar
search: baremodule SubArray GlobalRef BitArray clipboard backtrace BitMatrix takebuf_array catch_backtrace
This is struct Bar
help?> Bar.x
This is field x
I'm having the same issue.
Also running up against this issue
Me too!
Same here!
More generally, we encounter that simple multi-dot expressions may run into this error:
help?> DataType.name.names
ERROR: MethodError: no method matching Base.Docs.Binding(::Core.TypeName, ::Symbol)
Closest candidates are:
Base.Docs.Binding(::Module, ::Symbol) at docs/bindings.jl:9
Stacktrace:
[1] top-level scope
@ /data/vtjnash/julia/usr/share/julia/stdlib/v1.7/REPL/src/docview.jl:505
Same. Any update on this?
This was fixed by #59725
This was fixed by #59725
Doesn't look like it, unfortunately. The difference here relative to the other issue is that we're specifying the type parameter. cc @KristofferC
julia> versioninfo()
Julia Version 1.14.0-DEV.1341
Commit f5133098fa9 (2025-12-05 00:12 UTC)
Build Info:
Official https://julialang.org release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 16 × 12th Gen Intel(R) Core(TM) i7-1260P
WORD_SIZE: 64
LLVM: libLLVM-20.1.8 (ORCJIT, alderlake)
GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 16 virtual cores)
help?> Foo{Float64}.x
ERROR: MethodError: no method matching Base.Docs.Binding(::Type{Foo{Float64}}, ::Symbol)
The type `Base.Docs.Binding` exists, but no method is defined for this combination of argument types when trying to construct it.
Closest candidates are:
Base.Docs.Binding(::Module, ::Symbol)
@ Base docs/bindings.jl:7
Stacktrace:
[1] (::REPL.Logged{DataType})(::Type, ::Symbol)
@ REPL ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.14/REPL/src/docview.jl:180
[2] top-level scope
@ ~/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.14/REPL/src/docview.jl:26