When mangling a specialized use of a typealias in a protocol, we end up
with a "bound generic protocol" mangling, with the one substitution
replacing Self with some other type. Handle de-mangling and
re-mangling of such names.
Fixes rdar://problem/41549126.
When we are attempting to reconstruct a type node for a generic typealias,
make sure that we get the right number of generic arguments. If not,
fail gracefully rather than crashing.
Eventually, we should be able to handle this nested case.
This fixes the compiler side of the problem.
An lldb test will be added to make sure this doesn't regress
in the future (or, if it does, at least we know).
<rdar://problem/40261592>.
We're going to infer all these informations from the module, but
that's a large refactoring task which I'm going to do next.
In the meanwhile, this should allow Adrian's work to be unblocked.
<rdar://problem/38720742>
Adrian already found and reported a bug, which I'm going to fix
in a later commit. Eventually this will go away, but in the meanwhile,
we should add test for this codepath.
<rdar://problem/38720742>