Documentation
The documentation for the --warn-unreachable flag currently does not mention that unreachable blocks containing only a pass statement are silently ignored and do not trigger a warning. This creates confusion.
The current documentation lists two specific cases where unreachable statements are silenced:
- When the statement raises an error or terminates the program.
- When the statement is intentionally marked with platform/version checks.
The behavior for pass is a third, distinct case that is not documented.
Link: https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-warn-unreachable