@@ -3943,8 +3943,7 @@ NormalProtocolConformance *GetImplicitSendableRequest::evaluate(
39433943 DeclContext *conformanceDC = nominal;
39443944 if (attrMakingUnavailable) {
39453945 llvm::VersionTuple NoVersion;
3946- auto attr = new (ctx) AvailableAttr (attrMakingUnavailable->AtLoc ,
3947- attrMakingUnavailable->Range ,
3946+ auto attr = new (ctx) AvailableAttr (SourceLoc (), SourceRange (),
39483947 PlatformKind::none, " " , " " , nullptr ,
39493948 NoVersion, SourceRange (),
39503949 NoVersion, SourceRange (),
@@ -3954,8 +3953,11 @@ NormalProtocolConformance *GetImplicitSendableRequest::evaluate(
39543953
39553954 // Conformance availability is currently tied to the declaring extension.
39563955 // FIXME: This is a hack--we should give conformances real availability.
3956+ auto inherits = ctx.AllocateCopy (makeArrayRef (
3957+ InheritedEntry (TypeLoc::withoutLoc (proto->getDeclaredInterfaceType ()),
3958+ /* isUnchecked*/ true )));
39573959 auto extension = ExtensionDecl::create (ctx, attrMakingUnavailable->AtLoc ,
3958- nullptr , {} ,
3960+ nullptr , inherits ,
39593961 nominal->getModuleScopeContext (),
39603962 nullptr );
39613963 extension->setImplicit ();
@@ -3967,6 +3969,10 @@ NormalProtocolConformance *GetImplicitSendableRequest::evaluate(
39673969 std::move (nominal));
39683970 nominal->addExtension (extension);
39693971
3972+ // Make it accessible to getTopLevelDecls()
3973+ if (auto sf = dyn_cast<SourceFile>(nominal->getModuleScopeContext ()))
3974+ sf->getOrCreateSynthesizedFile ().addTopLevelDecl (extension);
3975+
39703976 conformanceDC = extension;
39713977 }
39723978
0 commit comments