mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Don't set type of AssociatedTypeDecl until we have an archetype
Otherwise the verifier can crash because hasType() returns true but getType() gives us a MetatypeType that hits a null pointer in desugaring. The computeType() calls appear in a few too many places for my liking; would be nice to clean this up further or replace everything with interface types one day. Fixes <rdar://problem/19606899>. Swift SVN r30388
This commit is contained in:
@@ -2155,6 +2155,7 @@ Decl *ModuleFile::getDecl(DeclID DID, Optional<DeclContext *> ForcedContext) {
|
||||
defaultDefinitionID);
|
||||
declOrOffset = assocType;
|
||||
|
||||
assocType->computeType();
|
||||
assocType->setAccessibility(cast<ProtocolDecl>(DC)->getFormalAccess());
|
||||
assocType->setSuperclass(getType(superclassID));
|
||||
assocType->setArchetype(getType(archetypeID)->castTo<ArchetypeType>());
|
||||
|
||||
Reference in New Issue
Block a user