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

function_loc gives wrong line #1419

Closed
simonbyrne opened this issue Oct 21, 2012 · 3 comments
Closed

function_loc gives wrong line #1419

simonbyrne opened this issue Oct 21, 2012 · 3 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@simonbyrne
Copy link
Contributor

If a method is defined by a function statement, function_loc returns the subsequent line. For example:

julia> function_loc(function_loc)
("/Users/simon/src/julia/base/util.jl",66)

when it actually starts on 65:
https://github.com/JuliaLang/julia/blob/master/base/util.jl#L65

@ghost ghost assigned JeffBezanson Feb 2, 2013
@JeffBezanson
Copy link
Member

I'm not sure I consider this the wrong line. For debugging, we need the line number of the first executing statement, which also suffices to uniquely locate the function.

@simonbyrne
Copy link
Contributor Author

Fair enough: I just noticed it when using the less function, and I found
the current behaviour a bit strange. Another use might be adding a "view
source" link in the html help, which I have found useful in the numpy and
Haskell docs.

@ViralBShah
Copy link
Member

Verified that this works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants