This seems like it requires a new version of sort!
to be compiled not only for each type signature (roughly what we currently do), but also for each type signature and for each calling context since the method tables of all functions that are called are different in different contexts. This seems like it would massively increase the amount of compilation required, not decrease it.
What if module A
instead defined
isless(x, y) = "surprise!"
This seems like it would cause sort!
to fail with a method error even though the two isless
functions are not the same generic function and Base is not trying to call the one that A
defines or exports.