Lint.jl
Lint.jl copied to clipboard
Generator expression handled incorrectly when there is if
julia> lintstr("""
f(x) = [tag for tag in x if iseven(tag)]
""")
2-element Array{Lint.LintMessage,1}:
none:1 E321 tag: use of undeclared symbol
none:1 I382 x: argument declared but not used
This seems to show up across the board with comprehensions.
julia> lintstr("""
f() = [x for x = 1:10 if iseven(x)]
g() = (y for y = 1:10 if iseven(x))
h() = Dict(z => z^2 for z = 1:10 if iseven(z))
""")
6-element Array{Lint.LintMessage,1}:
none:1 E321 x: use of undeclared symbol
none:2 E321 y: use of undeclared symbol
none:3 E321 z: use of undeclared symbol
none:3 E321 z: use of undeclared symbol
none:3 E321 z: use of undeclared symbol
none:3 E321 z: use of undeclared symbol
Yep, luckily I think all these cases can be handled similarly. I'll have a fix this weekend.