Sema: The primary associated type list references existing associated types instead of declaring new ones

This commit is contained in:
Slava Pestov
2022-04-03 21:11:01 -04:00
parent ecf8a35dc1
commit 8c47cd75fd
18 changed files with 149 additions and 164 deletions

View File

@@ -2777,13 +2777,11 @@ public:
TypeID defaultDefinitionID;
bool isImplicit;
ArrayRef<uint64_t> rawOverriddenIDs;
bool isPrimary;
decls_block::AssociatedTypeDeclLayout::readRecord(scratch, nameID,
contextID,
defaultDefinitionID,
isImplicit,
isPrimary,
rawOverriddenIDs);
auto DC = MF.getDeclContext(contextID);
@@ -2818,9 +2816,6 @@ public:
}
assocType->setOverriddenDecls(overriddenAssocTypes);
if (isPrimary)
assocType->setPrimary();
return assocType;
}
@@ -3666,8 +3661,10 @@ public:
if (declOrOffset.isComplete())
return declOrOffset;
auto proto = MF.createDecl<ProtocolDecl>(DC, SourceLoc(), SourceLoc(), name,
None, /*TrailingWhere=*/nullptr);
auto proto = MF.createDecl<ProtocolDecl>(
DC, SourceLoc(), SourceLoc(), name,
ArrayRef<PrimaryAssociatedTypeName>(), None,
/*TrailingWhere=*/nullptr);
declOrOffset = proto;
ctx.evaluator.cacheOutput(ProtocolRequiresClassRequest{proto},