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

unhelpful syntax error message when loop variable not a variable #900

Closed
mlubin opened this issue May 30, 2012 · 0 comments
Closed

unhelpful syntax error message when loop variable not a variable #900

mlubin opened this issue May 30, 2012 · 0 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@mlubin
Copy link
Member

mlubin commented May 30, 2012

Put the following snippet in a file, say foo.jl, and run load("foo.jl")

function foo()
    for 1 in 1:10
        bar()
    end
end

The error printed is:

syntax error: invalid assignment lvalue 1 at foo.jl:6
 in include at /mnt/hdd/work/julia/src/boot.jl:201
at foo.jl:0
 in load at util.jl:218

Note that the line referred to is the last line of the function, not the line with the actual error. This could lead to unneeded head-banging.

[pao: title]

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

2 participants