-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugmypy got something wrongmypy got something wrongtopic-error-reportingHow we report errorsHow we report errors
Description
Bug Report
If an if statement is unreachable, then mypy points to just the i
as the error.
To Reproduce
def x() -> None:
assert False
if 5:
print("yeah")
Expected Behavior
repro.py:3: error: Statement is unreachable [unreachable]
if 5:
^~~~~
Found 1 error in 1 file (checked 1 source file)
Actual Behavior
repro.py:3: error: Statement is unreachable [unreachable]
if 5:
^
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used: master
- Mypy command-line flags:
--warn-unreachable --pretty
- Mypy configuration options from
mypy.ini
(and other config files): none I think - Python version used: 3.12.4
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-error-reportingHow we report errorsHow we report errors