Open hpoit opened 6 years ago
David got something similar
What is the actionable change you'd like to see here?
dup of #24468? in that case fixed by #24512?
From the error message I had no idea what I was incorrectly doing. Your call.
I agree that the error message here is not good at all.
The line number is fixed, but the error message with Binding is still not great:
julia> @doc "bad doc" Int.afield
ERROR: MethodError: no method matching Base.Docs.Binding(::Type{Int64}, ::Symbol)
Closest candidates are:
Base.Docs.Binding(!Matched::Module, ::Symbol)
@ Base docs/bindings.jl:9
Stacktrace:
[1] top-level scope
@ REPL[2]:1
help?> Int.name.flags
ERROR: MethodError: no method matching Base.Docs.Binding(::Core.TypeName, ::Symbol)
Closest candidates are:
Base.Docs.Binding(!Matched::Module, ::Symbol)
@ Base docs/bindings.jl:9
Stacktrace:
[1] (::REPL.Logged{DataType})(::Core.TypeName, ::Vararg{Any})
@ REPL ~/julia/usr/share/julia/stdlib/v1.11/REPL/src/docview.jl:172
[2] top-level scope
@ ~/julia/usr/share/julia/stdlib/v1.11/REPL/src/docview.jl:607
help?> Int.name
ERROR: KeyError: key :fields not found
Stacktrace:
[1] getindex(h::Dict{Symbol, Any}, key::Symbol)
@ Base ./dict.jl:515
[2] fielddoc(binding::Base.Docs.Binding, field::Symbol)
@ REPL ~/julia/usr/share/julia/stdlib/v1.11/REPL/src/docview.jl:629
[3] fielddoc(object::Type, field::Symbol)
@ REPL ~/julia/usr/share/julia/stdlib/v1.11/REPL/src/docview.jl:644
[4] top-level scope
@ ~/julia/usr/share/julia/stdlib/v1.11/REPL/src/docview.jl:605
We should perhaps add a fallback constructor for Binding that throws a more specific error, rather than failing in these obscure ways.
When I run Weiqi.jl I get where line 522 of board.jl doesn't exist: https://github.com/hpoit/Weiqi.jl/blob/master/src/board.jl
The real issue was trying to document
"Test board"
for an assignment https://github.com/hpoit/Weiqi.jl/blob/master/src/board.jl#L28