Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix bug with inferring bad arguments to overloads #5660
Currently, it seems that when checking overloads, mypy starts by inferring the argument types in an empty context and swallows any errors generated in the process.
Mostly likely what the old overload implementation did next was recheck the arguments against the selected overload variant, regenerating any errors as necessary.
However, in the new overload implementation, it's unclear if we consistently do the same thing, mostly due to how we slice and dice the arguments to do things like union math.
This pull request does the low-effort thing and just removes the error suppression.
This pull request also does some unrelated clean-up -- apparently, the
I think this is a correct fix. I have just few minor comments.