File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -798,7 +798,30 @@ DeclContext *ConformanceLookupTable::getConformingContext(
798798 // Grab the superclass entry and continue searching for a
799799 // non-inherited conformance.
800800 // FIXME: Ambiguity detection and resolution.
801- entry = superclassDecl->ConformanceTable ->Conformances [protocol].front ();
801+ const auto &superclassConformances =
802+ superclassDecl->ConformanceTable ->Conformances [protocol];
803+ if (superclassConformances.empty ()) {
804+ assert (protocol->isSpecificProtocol (KnownProtocolKind::Sendable));
805+
806+ // Go dig for a superclass that does conform to Sendable.
807+ // FIXME: This is a hack because the inherited conformances aren't
808+ // getting updated properly.
809+ Type classTy = nominal->getDeclaredInterfaceType ();
810+ ModuleDecl *module = nominal->getParentModule ();
811+ do {
812+ Type superclassTy = classTy->getSuperclassForDecl (superclassDecl);
813+ if (superclassTy->is <ErrorType>())
814+ return nullptr ;
815+ auto inheritedConformance = module ->lookupConformance (
816+ superclassTy, protocol);
817+ if (inheritedConformance)
818+ return superclassDecl;
819+ } while ((superclassDecl = superclassDecl->getSuperclassDecl ()));
820+
821+ return nullptr ;
822+ }
823+
824+ entry = superclassConformances.front ();
802825 nominal = superclassDecl;
803826 }
804827
You can’t perform that action at this time.
0 commit comments