You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I confirm this. This honestly looks like a mystery, it looks like mypy applies a join instead of a union for attribute expressions, but understanding why would require some investigation.
Repro:
bug.py:
mypy incorrectly reports an error:
bug.py:22: error: Argument 1 to "bar" has incompatible type "object"; expected "Union[str, B]"
Interestingly, when
a.name
is aliased with another name, the issue disappers, i.e. the following is checked without an issue:ok.py:
The text was updated successfully, but these errors were encountered: