-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docstring for call / functor syntax #558
Comments
Is there any way to get around this for now? |
Just a few notes for future reference here: there is actually an upstream problem here too. The docstring storage does not distinguish between the call syntax methods and outer constructor methods: module Foo1
"Foo.Bar"
struct Bar
x :: Int
end
"constructor"
Bar(::String) = Bar(0)
"call syntax"
(::Bar)(::Array) = 1
end
In fact, you can see that it gets overwritten: module Foo2
"Foo.Bar"
struct Bar
x :: Int
end
"constructor"
Bar(::String) = Bar(0)
"call syntax"
(::Bar)(::String) = 1
end
|
What's the status of this? I don't know how Docs.jl works internally, but your example seems to work if I just call julia> module Foo1
"Foo.Bar"
struct Bar
x :: Int
end
"constructor"
Bar(::String) = Bar(0)
"call syntax"
(::Bar)(::Array) = 1
end
Main.Foo1
julia> using .Foo1
julia> @doc Foo1.Bar(::String) # constructor
julia> @doc (::Foo1.Bar)(::Array) # call syntax so is there a reason this doesn't also work with Documenter.jl? (i.e., why does it matter if the docs get overwritten?) |
No, it still gets overwritten in 1.9 as far as I can tell:
|
Here is a workaround that I'm using, just in case it's useful to anyone else. Juliamodule M
struct Real end
struct Fake end
"""Real"""
function Real(x) end
"""(::Real)"""
function Real(::Fake) end
function (::Real) end
end # module Markdown
HTML
|
Documenter cannot handle the new call syntax.
In the REPL one can access the docstring as follows:
When I include it using
I get:
The text was updated successfully, but these errors were encountered: