Skip to content

Incorrect unused variable diagnosis in loops #405

Description

@keith

With this code:

def foo():
    found = False
    for i in range(10):
        if found:
            break
        if i == 5:
            found = True
    return ""

You see this warning about found never being accessed:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions