ModuleInterface: Resolve inherited types when computing unsatisfiable conformances.

Previously, unsatisfiable conformances could be omitted from emitted
`.swiftinterface` files in lazy typechecking mode since inherited types might
be unresolved when gathering the conformances.

Adding these test cases also revealed that serialization restrictions needed to
be relaxed in order to accomodate unsatisfiable conformances.
This commit is contained in:
Allan Shortlidge
2023-09-07 00:19:32 -07:00
parent eee122c093
commit 7c1b150f39
7 changed files with 64 additions and 13 deletions

View File

@@ -527,8 +527,9 @@ class InheritedProtocolCollector {
/// For each type directly inherited by \p extension, record any protocols
/// that we would have printed in ConditionalConformanceProtocols.
void recordConditionalConformances(const ExtensionDecl *extension) {
for (TypeLoc inherited : extension->getInherited().getEntries()) {
Type inheritedTy = inherited.getType();
auto inheritedTypes = extension->getInherited();
for (unsigned i : inheritedTypes.getIndices()) {
Type inheritedTy = inheritedTypes.getResolvedType(i);
if (!inheritedTy || !inheritedTy->isExistentialType())
continue;