Skip to content

used-before-assignment and undefined-loop-variable false positives with regard to function annotation #1082

Closed
@PCManticore

Description

@PCManticore

Given a function such as the following, we are getting used-before-assignment and undefined-loop-variable for the annotation, while we should retrieve an undefined-variable message, since the variable is actually not defined there.


def test(a:x):
   if x == 2:
      for x in [1, 2]:
          pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions