PotentialArchetype::getNestedType() was effectively reimplementing a
simplified form of mapTypeOutOfContext(), missing some cases in the
process. Just use mapTypeOutOfContext() and resolveArchetype(). While
here, stop re-implementing the addSameType* operations; just call them
directly. With these changes, we no longer need the "typealias in
protocol is too complex" diagnostic.
Eliminates another use of getSelfTypeInContext().
This time, propagate the decl marked deprecated or unavailable through
to the fix-it, so we can be sure it's a var.
https://bugs.swift.org/browse/SR-1649