Commits

Doug Gregor committed d0ab6890f8c
Start allowing extensions of protocol types. Remove the semantic restrictions that prohibited extensions of protocol types, and start making some systematic changes so that protocol extensions start to make sense: - Replace a lot of occurrences of isa<ProtocolDecl> and dyn_cast<ProtocolDecl> on DeclContexts to use the new DeclContext::isProtocolOrProtocolExtensionContext(), where we want that behavior to apply equally to protocols and protocol extensions. - Eliminate ProtocolDecl::getSelf() in favor of DeclContext::getProtocolSelf(), which produces the appropriate generic type parameter for the 'Self' of a protocol or protocol extension. Update all of the callers of ProtocolDecl::getSelf() appropriately. - Update extension validation to appropriately form generic parameter lists for protocol extensions. - Methods in protocol extensions always use the witnesscc calling convention. At this point, we can type check and SILGen very basic definitions of protocol extensions (without associated types, IRGen crashes, etc.) with methods that can call protocol requirements, generic free functions, and other methods within the same protocol extension. This is identical to r26579; the prior commit addressed the underlying conformance substitution problem that caused rdar://problem/20320393 and subsequent reversion of r26579. Swift SVN r26639