Skip to content

Linter reports missing reference for assignments within while block condition #273

Description

@Holbormon

julia-vscode/julia-vscode#3550 was closed as outdated starting with release 1.220.0, but I can still reproduce the bug on pre-release 1.230.0, with the same MRE:

function rand_or_nothing()

    if (foo = rand()) < .5
        return foo
    end

    return foo + 1

end

while (bar = rand_or_nothing()) < .7
    display(bar)
end

display(bar) # -> Yields Missing reference: bar StaticLint.jl(missing_reference)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions