Open tvuotila opened 1 week ago
Bug Report
Iterator doesn't require a return statement except when used in an union.
Iterator
To Reproduce
from typing import Iterator, Union Type = Union[Iterator[int], int] def foo() -> Type: yield 1
playground link
Actual Behavior
error: Missing return statement [return]
Expected behavior
I expected Mypy to not return any errors like
from typing import Iterator, Union Type = Iterator[int] def foo() -> Type: yield 1
Your Environment
mypy.ini
Bug Report
Iterator
doesn't require a return statement except when used in an union.To Reproduce
playground link
Actual Behavior
error: Missing return statement [return]
Expected behavior
I expected Mypy to not return any errors like
Your Environment
mypy.ini
(and other config files): none