Julia: Spurious error about local name conflicting with argument

Created on 6 Jul 2018  路  2Comments  路  Source: JuliaLang/julia


function test(x)
    Any[x for x in []]
end

gives

ERROR: syntax: local variable name "x" conflicts with an argument

but

function test(x)
    [x for x in []]
end

works.

julia> VERSION
v"0.7.0-beta.154"
bug lowering

Most helpful comment

You folks really like to reuse variable names, don't you. ;)

All 2 comments

You folks really like to reuse variable names, don't you. ;)

x

Was this page helpful?
0 / 5 - 0 ratings