Skip to content
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

Display parametric types in a better way? #109

Open
ShuhuaGao opened this issue Feb 7, 2021 · 2 comments
Open

Display parametric types in a better way? #109

ShuhuaGao opened this issue Feb 7, 2021 · 2 comments

Comments

@ShuhuaGao
Copy link

Consider the following two functions in module CGP.

"""
$(TYPEDSIGNATURES)
"""
function fun1(x::AbstractVector{<:Real})
end


"""
$(TYPEDSIGNATURES)
"""
function fun2(x::AbstractVector{T}) where T<:Real
end

The following documentation is produced.
image

I noticed two issues.

  1. The AbstractVector in fun2 becomes AbstractArray again even if I am using Julia 1.6.0. (See How to use alias of AbstractArray instead of the full name? (Feature request) #108)
  2. In fun1, the implicit type parameter is an ugly var"#s2". Is it possible to just show the original form x::AbstractVector{<:Real}?
@MichaelHatherly
Copy link
Member

Would be worthwhile just solving these upstream in base Julia rather than trying to work around it here since DocStringExtensions.jl is just, for the most part, utilizing the implementations from Base.

@MichaelHatherly
Copy link
Member

Will be possible make use of #133 to get hold of the actual expression that generates the type and then use that to print something nicer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants