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

show current-world number of methods for display(::Function) #19889

Merged
merged 1 commit into from
Jan 6, 2017

Conversation

stevengj
Copy link
Member

@stevengj stevengj commented Jan 6, 2017

Functions are displayed in the REPL as foo (generic function with N methods). Before this PR, N was the number of methods ever defined, even methods that have been overwritten. After this PR, N is the number in the current world, matching the number displayed by methods(foo).

Before this PR:

julia> f(x) = 3
f (generic function with 1 method)

julia> f(x) = 4
WARNING: Method definition f(Any) in module Main at REPL[1]:1 overwritten at REPL[2]:1.
f (generic function with 2 methods)

After this PR:

julia> f(x) = 3
f (generic function with 1 method)

julia> f(x) = 4
WARNING: Method definition f(Any) in module Main at REPL[1]:1 overwritten at REPL[2]:1.
f (generic function with 1 method)

(Note that #19888 eliminates the warning.)

@JeffBezanson
Copy link
Member

(fixes #19781)

@stevengj stevengj merged commit 32fd14c into JuliaLang:master Jan 6, 2017
@stevengj stevengj deleted the methodcount branch January 6, 2017 12:12
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

Successfully merging this pull request may close these issues.

2 participants