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

BoundsError line numbers in 0.4 #13818

Closed
KristofferC opened this issue Oct 29, 2015 · 3 comments
Closed

BoundsError line numbers in 0.4 #13818

KristofferC opened this issue Oct 29, 2015 · 3 comments
Labels
error handling Handling of exceptions by Julia or the user regression Regression in behavior compared to a previous version

Comments

@KristofferC
Copy link
Member

I know there are some line number problems on master but I don't find an issue about if for 0.4. The code is run on Ubuntu with 0.4.0.

For example, this function:

function foo(a)
    println(a[1])
    println(a[2])
    println(a[3])
end

prints the error at the wrong line:

julia> foo(rand(2))
0.5271584365311086
0.31406425255176895
ERROR: BoundsError: attempt to access 2-element Array{Float64,1}:
 0.527158
 0.314064
  at index [3]
 in foo at /home/kristoffer/Documents/berror.jl:2

However, if I comment out the other usages of a I get the correct line number:

function foo2(a)
    #println(a[1])
    #println(a[2])
    println(a[3])
end
julia> foo2(rand(2))
ERROR: BoundsError: attempt to access 2-element Array{Float64,1}:
 0.941166
 0.794457
  at index [3]
 in foo2 at /home/kristoffer/Documents/berror2.jl:4

It seems that when I get the wrong line number for a BoundsError, the line that is getting reported is an earlier line where the same variable is getting used.

@KristofferC KristofferC changed the title BoundsError line number in 0.4 BoundsError line numbers in 0.4 Oct 29, 2015
@JeffBezanson
Copy link
Member

Probably #922 and #13491

@JeffBezanson JeffBezanson added regression Regression in behavior compared to a previous version error handling Handling of exceptions by Julia or the user backport pending 0.4 labels Oct 29, 2015
@tkelman
Copy link
Contributor

tkelman commented Jan 8, 2016

This might be a wontfix unless someone can come up with a less-breaking-than-#13491 fix specifically for release-0.4.

@tkelman
Copy link
Contributor

tkelman commented Mar 15, 2016

should be fixed by #15385

@tkelman tkelman closed this as completed Mar 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error handling Handling of exceptions by Julia or the user regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

3 participants