- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 5.7k
Closed
Copy link
Labels
REPLJulia's REPL (Read Eval Print Loop)Julia's REPL (Read Eval Print Loop)bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviordocsystemThe documentation building systemThe documentation building system
Description
Hi,
On julia 1.11.6 we can document the fields of a struct, as described in here in the Julia documentation.
If I define:
"MyStruct type docstring"
struct MyStruct
    "x docstring"
    x::Float64
end
I get in the REPL help-mode (as expected):
help?> MyStruct
search: MyStruct struct abstract
  MyStruct type docstring
help?> MyStruct.x
  x docstringBut, If I define a parametric struct:
"MyParamStruct type docstring"
struct MyParamStruct{T<:Real}
    "x docstring"
    x::T
endI get:
help?> MyParamStruct
search: MyParamStruct MyStruct
  MyParamStruct type docstring
help?> MyParamStruct.x
ERROR: MethodError: no method matching Base.Docs.Binding(::Type{MyParamStruct}, ::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:9
Stacktrace:
 [1] (::REPL.Logged{DataType})(::Type, ::Vararg{Any})
   @ REPL ~/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/docview.jl:174
 [2] top-level scope
   @ ~/.julia/juliaup/julia-1.11.6+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/docview.jl:632The help-mode of the REPL should also work for the fields of a parametric struct.
Thanks!
Metadata
Metadata
Assignees
Labels
REPLJulia's REPL (Read Eval Print Loop)Julia's REPL (Read Eval Print Loop)bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviordocsystemThe documentation building systemThe documentation building system