-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
I have something similar to the following setup where I try to create a zero argument constructor for a parametric struct:
using DocStringExtensions
"""
# struct definition
My test struct with fields
$(TYPEDFIELDS)
"""
struct MyStruct{T<:Number}
a::T
end
"""
# empty constructor. Call with
$(SIGNATURES) or:
$(TYPEDSIGNATURES)
"""
function MyStruct{T}() where {T<:Number}
return MyStruct{T}(one(T))
endThe constructed documentation look like this:
help?> MyStruct
search: MyStruct
struct definition
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
My test struct with fields
• a::Number
────────────────────────────────────────
empty constructor. Call with
≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡
MyStruct(a)
or:
MyStruct(a::Number) -> MyStructWhich does not reproduce the signature of the parametric constructor. Ideally, I would expect something like
MyStruct{T}() for $SIGNATURES andMyStruct{T<:Number}() -> MyStruct for $TYPEDSIGNATURES.
(In the documenter build, the result of SIGNATURES and TYPEDSIGNATURES seems to just be empty, hence the empty in the title.)
Metadata
Metadata
Assignees
Labels
No labels