Closed
Description
I introduced this problem on gitter, and am posting this as an issue after confirmation there.
The code below is a much-simplified piece of code to explore if strict-optional could be valid for some recent improved typing of request.pyi in current zulip.
(zulip/zulip@42f5eea)
The simplified code below produces the error:
error: "X" does not return a value
I thought this was just with strict-optional, but the reduced code gives this issue without too, so I think I must have lost the extra code which caused that difference.
from typing import TypeVar, Optional
T = TypeVar('T')
def X(val: T) -> T: ...
x_in = None
def Y(x: Optional[str] = X(x_in)): ...
The last line is not required specifically, for example the following also triggers the error in the same way:
xx: Optional[int] = X(x_in)