Open
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