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

UndefVarError not raised if the variable is not used #13290

Closed
yuyichao opened this issue Sep 23, 2015 · 1 comment
Closed

UndefVarError not raised if the variable is not used #13290

yuyichao opened this issue Sep 23, 2015 · 1 comment

Comments

@yuyichao
Copy link
Contributor

Having a unused undefined variable in a function doesn't seems to cause an error...

julia> function f(a)
           println(1)
           aaaaaa
           println(2)
       end
f (generic function with 1 method)

julia> f(1)
1
2

julia> @code_lowered f(1)
1-element Array{Any,1}:
 :($(Expr(:lambda, Any[:a], Any[Any[Any[:a,:Any,0]],Any[],0,Any[]], :(begin  # none, line 2:
        (Main.println)(1) # none, line 3: # none, line 4:
        return (Main.println)(2)
    end))))
@mbauman
Copy link
Sponsor Member

mbauman commented Sep 23, 2015

Dup of the likely unsearchable "if cond then works" issue: #6846

@mbauman mbauman closed this as completed Sep 23, 2015
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