Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for detecting overloads with overlapping arities #5163
This commit addresses TODO 2 from #5119 by adding support for detecting overloads with partially overlapping arities.
It also refactors the
referenced this pull request
Jun 15, 2018
ilevkivskyi left a comment
Great job! I didn't look carefully though all the changes to the code. But all the tests look good, except for one questionable test. If it is not easy to fix, please just go ahead and merge (this is really a corner case).
I could have sworn I fixed the field/parameter thing, but I guess not -- thanks for the (re)-catch!
Regarding the test case: I think I'm going to just merge this as-is. I did a bit of poking and I think it's possible to convert that error case back into a pass, but it'll be a bit kludgy. We basically need to special-case the first match an *arg or **kwarg has so we can pretend that args/kwargs is never length 0. I'm thinking we can add in this kludge later if it turns out it's impossible to type certain things w/ the current semantics.
I think this is also more or less consistent with how we handle non-kwarg/non-arg signatures -- for example, this PR considers the following overload to be unsafely overlapping.
I think it'd maybe be a bit surprising if swapping the last signature for a