Open LilithHafner opened 1 year ago
The method errors should be fixed. Other than that it looks like it basically requires everything in the chain to be constant?
It looks like the docstring for a field is only accessible through the REPL help mode if there's also a docstring for the type.
/home/fredrikb> julia +beta --startup-file=no
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _' | |
| | |_| | | | (_| | | Version 1.10.0-beta3 (2023-10-03)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> struct T
"x"
x
"y"
y
end
help?> T.x
T has fields x, and y.
julia> "..."
struct T
"x"
x
"y"
y
end
T
help?> T.x
x
If I further add a type parameter for the field x
, I instead get the error from the OP
julia> struct T{X}
"x"
x::X
"y"
y
end
help?> T.x
ERROR: MethodError: no method matching Base.Docs.Binding(::Type{T}, ::Symbol)
Closest candidates are:
Base.Docs.Binding(::Module, ::Symbol)
@ Base docs/bindings.jl:9
Stacktrace:
[1] top-level scope
@ ~/.julia/juliaup/julia-1.10.0-beta3+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/docview.jl:558
Thanks for looking into this! Those results seem a little buggy.
I don't really see a pattern of when the REPL provides useful hints on this sort of field access and when it throws what appears to be an internal error: