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
Thanks for the bug report! It looks to me like we're not computing the join of Callables correctly. This might be a quick fix -- I'll see if I can take a look in the next couple days!
You can make this program typecheck by adding an annotation # type: List[Callable[[int], object]] to the list. It does seem like mypy should probably be able to work that out itself, though.
Fixes#1983
Here I implement:
* join(Callable[[A1], R1]), Callable[[A2], R2]) == Callable[[meet(A1, A2)], join(R1, R2)]
* meet(Callable[[A1], R1]), Callable[[A2], R2]) == Callable[[join(A1, A2)], meet(R1, R2)]
plus special cases for Any, overloads, and callable type objects.
The meet and join are still not perfect, but I think this PR improves the situation.
I've looked for a similar report but couldn't find any - forgive me if there is one.
It seems to me that this code should pass type check:
mypy a284c48 doesn't like it:
The text was updated successfully, but these errors were encountered: