Merge pull request #21244 from jckarter/archetype-subclasses

Split subclasses out of ArchetypeType.
This commit is contained in:
Joe Groff
2018-12-12 11:49:48 -08:00
committed by GitHub
13 changed files with 295 additions and 138 deletions

View File

@@ -1020,7 +1020,7 @@ static void bindArchetypesFromContext(
ConstraintLocator *locatorPtr,
const OpenedTypeMap &replacements) {
auto bindContextArchetype = [&](Type paramTy, Type contextTy) {
auto bindPrimaryArchetype = [&](Type paramTy, Type contextTy) {
auto found = replacements.find(cast<GenericTypeParamType>(
paramTy->getCanonicalType()));
@@ -1044,7 +1044,7 @@ static void bindArchetypesFromContext(
if (parentDC != outerDC && parentDC->getSelfProtocolDecl()) {
auto selfTy = parentDC->getSelfInterfaceType();
auto contextTy = cs.TC.Context.TheUnresolvedType;
bindContextArchetype(selfTy, contextTy);
bindPrimaryArchetype(selfTy, contextTy);
}
continue;
}
@@ -1056,7 +1056,7 @@ static void bindArchetypesFromContext(
for (auto *paramTy : genericSig->getGenericParams()) {
Type contextTy = cs.DC->mapTypeIntoContext(paramTy);
bindContextArchetype(paramTy, contextTy);
bindPrimaryArchetype(paramTy, contextTy);
}
break;