-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Line Number Accuracy #18273
Comments
I should add this occurred with both 0.5-rc1 and the more recent Julia Version 0.6.0-dev.201
Commit e4b5233* (2016-08-13 16:10 UTC)
Platform Info:
System: Linux (x86_64-linux-gnu)
CPU: Intel(R) Core(TM) i7 CPU Q 820 @ 1.73GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.7.1 (ORCJIT, nehalem) |
Note that fixing this should be careful to not break coverage line number. |
This has come up before --- we only keep the line number for the first line of code in the function, since that's the one we need for coverage and error reporting. It still uniquely and correctly identifies the function so I don't consider this a significant problem. |
The line number of the first statement does uniquely identify the function, but incorrectly identifies the error. For example, in the original code the second function was calling the first function on the first line, so it appeared calling the function was overwriting it. |
The warning in this case isn't really confusing since it's pretty clear where the override is. It could be more confusing if the first line is a function definition though.
Not actually true when there's nested function definition. It is possible to define multiple functions in one line but the currently lineno handling does cause some false positive. |
Line numbers are sometimes off by more than a few lines. Right now I'm working on a script (180 lines) but when I include the script, I get a method error referencing an expression starting on line 480. If I can create a small example I'll update this comment. [Edit: see below]
Maybe that 480 refers to something in Edit: This is on 0.5.0-rc3. @yuyichao Sounds like this issue is already well known, but let me know if you want me to open an issue. Edit2: Here's a minimal example. File
Running it:
|
@evanfields this is a different issue. I mostly see this happen when there's macros that messes up line number info. Please also include the exact version of julia you are using when you report the issue. |
Confirmed fixed by #35138 |
Line numbers are off by a few lines, causing confusion. Here is a minimal standalone example:
gives output:
lines 24 and 36 contain the
println
statements, rather than the function declarations.The text was updated successfully, but these errors were encountered: