ModuleInterface: Resolve inherited types when recording indirect conformances.

Previously, indirect public conformances provided by conforming to an internal
protocol could be skipped in a `.swiftinterface` in lazy typechecking mode
since inherited types might not be resolved before collecting the indirect
conformances.
This commit is contained in:
Allan Shortlidge
2023-09-06 16:59:10 -07:00
parent 435f623caf
commit eee122c093
5 changed files with 28 additions and 2 deletions

View File

@@ -483,8 +483,8 @@ class InheritedProtocolCollector {
bool skipExtra = false) {
llvm::Optional<AvailableAttrList> availableAttrs;
for (InheritedEntry inherited : directlyInherited.getEntries()) {
Type inheritedTy = inherited.getType();
for (int i : directlyInherited.getIndices()) {
Type inheritedTy = directlyInherited.getResolvedType(i);
if (!inheritedTy || !inheritedTy->isExistentialType())
continue;
@@ -492,6 +492,7 @@ class InheritedProtocolCollector {
if (!canPrintNormally && skipExtra)
continue;
auto inherited = directlyInherited.getEntry(i);
ExistentialLayout layout = inheritedTy->getExistentialLayout();
for (ProtocolDecl *protoDecl : layout.getProtocols()) {
if (canPrintNormally)