-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working
Description
I've narrowed a typing failure down to the following snippet:
# pyright: reportUnusedVariable=true
def f(a: int):
b = {}
c = a
used = 1
for _ in range(1):
if a:
pass
if 0:
b[c].append(0)
c = used if 1 else 0
f(0)With pyright==1.1.401, this yields: error: Variable "used" is not accessed.
This seems incorrect - if I remove used = 1, then this crashes with NameError: name 'used' is not defined.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
addressed in next versionIssue is fixed and will appear in next published versionIssue is fixed and will appear in next published versionbugSomething isn't workingSomething isn't working