julia-vscode / StaticLint.jl

Static Code Analysis for Julia
Other
145 stars 28 forks source link

Error when assigning to variable inside `let` defined in the outer scope #393

Open fredrikekre opened 2 months ago

fredrikekre commented 2 months ago

This made me question my understanding of scopes

function f()
    x = 1
    let y = 2
        x = y + 1     ■ Variable has been assigned but not used.
    end
    return x
end