Improve error messages by highlighting unmatched argument
I'm currently trying to fix a couple of type errors with the following form, and it's very difficult to find which argument is not matching the type signature.
From inspection I can see that the second and third parameters seem OK, since they are have expanded to the same string, but core.typed does not tell me if the problem is with the first, fourth, or both arguments.
Not planning to improve myself, patches welcome.
I submitted to soon and I don't seem to have edit permission – I was going to suggest that the error message include the argument index of the failing type-check, and print the expected and given types as an extra message. It would be even better if you could pull out the parameter name given when the function is defined: