Yes, it should be semantic guarantee, I thought this is possible too with @_specialize when I read it correctly it should be possible to make the signature visible to end users and this is likewise required for correct specialization.
The compiled binary should store this kind of overloaded set in a demangled form. When signatures are public, then any dynamic linked lib must provide these functions with the same signature in demangled form.
No, callees must be demangled (callees can be indirectly callers too). The caller can also be demangled, but I would leave the compiler the decision if dispatching occurs statically or dynamically as far as I understand Swift's Generics model.
Yet I understand what you mean, I wasn't even aware that Swift supports cyclic imports, but yes it should throw a compiler error. And yes, adding an overload can lead to error, what is so strange about that?
These overloads overlap, ambiguity is implied.
Case 3, yes. Because of String is the best match, the nearest neighbor.
Case 4. Introducing more than one argument will increase ambiguity as more sets overlap.
Just to say, there exists an overload resolution in C++ and in D to handle these cases, even Rust want to utilize full specialization, but as it seems, they can't because of their trouble with lifetime erasure.
You presented extreme cases, here and I don't want to propose it as a sole replacement of current dispatching.
Edit: Correctly thinking about, we may don't demangling, however we need to get access to all methods signature and to select methods out of multi function.