[Serialization] Allow conformances with no witness if allowing errors

Note that deserialization already handles this case when recovery is
enabled.
This commit is contained in:
Ben Barham
2021-06-01 10:36:27 +10:00
parent 6d038c86bc
commit 1fea98cbad
2 changed files with 16 additions and 1 deletions

View File

@@ -1460,7 +1460,8 @@ void Serializer::writeASTBlockEntity(
data.push_back(addDeclRef(req));
data.push_back(addDeclRef(witness.getDecl()));
assert(witness.getDecl() || req->getAttrs().hasAttribute<OptionalAttr>()
|| req->getAttrs().isUnavailable(req->getASTContext()));
|| req->getAttrs().isUnavailable(req->getASTContext())
|| allowCompilerErrors());
// If there is no witness, we're done.
if (!witness.getDecl()) return;