Sema: Tighten up DependentGenericTypeResolver::resolveDependentMemberType()

Final patch in the nested-generics saga for the time being.

The check was added because the null archetype case was previously hit
by several hundred compiler crashers.

Now that generic parameter lists are chained properly, we can
re-introduce an assertion here without any of them regressing.
This commit is contained in:
Slava Pestov
2015-12-14 13:53:50 -08:00
parent d6ea5d8717
commit 429fd7cc1d

View File

@@ -31,8 +31,7 @@ Type DependentGenericTypeResolver::resolveDependentMemberType(
SourceRange baseRange,
ComponentIdentTypeRepr *ref) {
auto archetype = Builder.resolveArchetype(baseTy);
if (!archetype)
return ErrorType::get(DC->getASTContext());
assert(archetype && "Bad generic context nesting?");
return archetype->getRepresentative()
->getNestedType(ref->getIdentifier(), Builder)
@@ -44,8 +43,7 @@ Type DependentGenericTypeResolver::resolveSelfAssociatedType(
DeclContext *DC,
AssociatedTypeDecl *assocType) {
auto archetype = Builder.resolveArchetype(selfTy);
if (!archetype)
return ErrorType::get(DC->getASTContext());
assert(archetype && "Bad generic context nesting?");
return archetype->getRepresentative()
->getNestedType(assocType->getName(), Builder)