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

Do not include unbound TypeVar when showing methods #11409

Closed
yuyichao opened this issue May 23, 2015 · 2 comments
Closed

Do not include unbound TypeVar when showing methods #11409

yuyichao opened this issue May 23, 2015 · 2 comments

Comments

@yuyichao
Copy link
Contributor

Guess which one is which

julia> type A{T, V} end

julia> f{T, V}(::A{T, V}, ::A{T, V}) = 1
f (generic function with 1 method)

julia> f{T, V}(::A, ::A{T, V}) = 1
f (generic function with 2 methods)

julia> methods(f)
#2 methods for generic function "f":
f{T,V}(::A{T,V},::A{T,V}) at none:1
f{T,V}(::A{T,V},::A{T,V}) at none:1

IMHO, it would be nice to print the second definition as

f{T, V}(::A, ::A{T, V})

And just omit the unbounded TypeVar parameters of A

Actually I would almost argue that printing the parameter name of a parametrized type in general is quite confusing. I still can't stop copying sth like Array{T, N} into the code and get a UndefVarError = = ...

@simonster
Copy link
Member

Dup of #10794?

@yuyichao
Copy link
Contributor Author

Yes.

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