Fix an arg-handling bug in typeCallInternal
In typeCallInternal, we used to expand out any starargs in order to take a look at the first arg (and change it when passing it). We had a bug in this code, and rather than make that code more complicated to fix it, just call back into callFunc to resolve it. This is kind of tricky since callFunc will call typeCall, and we don't want typeCall to duplicate the typeCallInternal behavior (that's not any better than duplicating the arg behavior), so we want typeCall to call into typeCallInternal. But typeCall receives varargs! which typeCallInternal doesn't support. So typeCall has to do some (simpler) arg handling to expand out the varargs. In the end, it simplifies the code a little bit but causes a bunch of extra calls in the varargs case, so it's less of a win than I thought, but at least it fixes the bug.
Showing
Please register or sign in to comment