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

Line numbering is broken #1121

Closed
timholy opened this issue Aug 7, 2012 · 2 comments
Closed

Line numbering is broken #1121

timholy opened this issue Aug 7, 2012 · 2 comments

Comments

@timholy
Copy link
Member

timholy commented Aug 7, 2012

Save this to a file:

function line_offby1(v::Vector)
    if length(v) > 30
        error("Too large!")
    end
    print(v[1])
    print(v[31])
end

function line_offby2(v::Vector)
    if length(v) > 30
        error("Too large!")
    end
    print(v[1])
    for i = 1:20
        print(v[31])
    end
end

Then load the file and try this:

v = randn(5)
line_offby1(v)
line_offby2(v)

The offby2 one is off by 2 not because it comes second in the file (it's not cumulative across functions), but because of the for loop.

@timholy
Copy link
Member Author

timholy commented Aug 7, 2012

Can we have a test for this in test/?

@JeffBezanson
Copy link
Member

Dup of #922.

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