mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user