-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-reachabilityDetecting unreachable codeDetecting unreachable code
Description
Bug Report
false positive unreachable
To Reproduce
a: object = None
def foo() -> None:
global a
a = None
bar()
if a:
print("hi")
def bar() -> None:
global a
a = 1Expected Behavior
no error
Actual Behavior
main.py:8: error: Statement is unreachable
Found 1 error in 1 file (checked 1 source file)
(Write what happened.)
Your Environment
https://mypy-play.net/?mypy=latest&python=3.10&flags=warn-unreachable&gist=c41cd432e95c591743aa1369f36823d1
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongfalse-positivemypy gave an error on correct codemypy gave an error on correct codetopic-reachabilityDetecting unreachable codeDetecting unreachable code