Implicitly build "missing" conformances to Sendable.

When looking up a conformance to Sendable fails, implicitly create a
"missing" builtin conformance. Such conformances allow type checking
to continue even in the presence of Sendable-related problems.

Diagnose these missing conformances when they are used in an actual
program, as part of availability checking for conformances and when we
are determining Sendability. This allows us to decide between an
error, a warning, and suppressing the diagnostic entirely without
affecting how the program is compiled. This is a step toward enabling
selective enforcement of Sendable.

Part of rdar://78269348.
This commit is contained in:
Doug Gregor
2021-07-28 16:56:35 -07:00
parent 64c670745a
commit c79fa23339
13 changed files with 176 additions and 45 deletions

View File

@@ -1625,7 +1625,8 @@ Serializer::writeConformance(ProtocolConformanceRef conformanceRef,
auto protocolID = addDeclRef(builtin->getProtocol());
auto genericSigID = addGenericSignatureRef(builtin->getGenericSignature());
BuiltinProtocolConformanceLayout::emitRecord(
Out, ScratchRecord, abbrCode, typeID, protocolID, genericSigID);
Out, ScratchRecord, abbrCode, typeID, protocolID, genericSigID,
static_cast<unsigned>(builtin->getBuiltinConformanceKind()));
writeGenericRequirements(builtin->getConditionalRequirements(), abbrCodes);
break;
}