Closed
Description
Bug Report
The "Missing return statement" error misfires on with
blocks.
To Reproduce
Create the following python file:
import contextlib
def foo() -> int:
with contextlib.ExitStack() as stack:
return 2
Run mypy
:
Expected Behavior
There should be no error
Actual Behavior
this_issue.py:3: error: Missing return statement
Found 1 error in 1 file (checked 1 source file)
Your Environment
- Mypy version used: 0.910
- Python version used: 3.8
- Operating system and version: Windows 10