Bug Report
A platform check that is working fine in if and else is not working after if ... return.
To Reproduce
import sys def works() -> None: if sys.platform != "win32": return else: from winreg import REG_SZ def fails() -> None: if sys.platform != "win32": return from winreg import REG_SZ
https://mypy-play.net/?mypy=latest&python=3.11&gist=eddad091a6082bd85c5c7524839726b1
Expected Behavior
No error.
Actual Behavior
main.py:12: error: Module "winreg" has no attribute "REG_SZ" [attr-defined] Found 1 error in 1 file (checked 1 source file)
Your Environment
Activity