Closed
Description
Consider:
def f(flag; bool) -> Optional[int]:
a = (None if flag else 0)
return a
When run with --strict-optional
I get the error
error: Incompatible return value type (got "object", expected "Optional[int]")
It looks like the unification code is not understanding what's going on and falling back on object
.