@@ -4515,21 +4515,6 @@ static bool diagnoseHasSymbolCondition(PoundHasSymbolInfo *info,
45154515 return true ;
45164516 }
45174517
4518- auto fragileKind = DC->getFragileFunctionKind ();
4519- if (fragileKind.kind != FragileFunctionKind::None) {
4520- // #_hasSymbol cannot be used in inlinable code because of limitations of
4521- // the current implementation strategy. It relies on recording the
4522- // referenced ValueDecl, mangling a helper function name using that
4523- // ValueDecl, and then passing the responsibility of generating the
4524- // definition for that helper function to IRGen. In order to lift this
4525- // restriction, we will need teach SIL to encode the ValueDecl, or take
4526- // another approach entirely.
4527- ctx.Diags .diagnose (info->getStartLoc (),
4528- diag::has_symbol_condition_in_inlinable,
4529- fragileKind.getSelector ());
4530- return true ;
4531- }
4532-
45334518 auto decl = info->getReferencedDecl ().getDecl ();
45344519 if (!decl) {
45354520 // Diagnose because we weren't able to interpret the expression as one
@@ -4538,7 +4523,8 @@ static bool diagnoseHasSymbolCondition(PoundHasSymbolInfo *info,
45384523 return true ;
45394524 }
45404525
4541- if (!decl->isWeakImported (DC->getParentModule ())) {
4526+ if (DC->getFragileFunctionKind ().kind == FragileFunctionKind::None &&
4527+ !decl->isWeakImported (DC->getParentModule ())) {
45424528 // `if #_hasSymbol(someStronglyLinkedSymbol)` is functionally a no-op
45434529 // and may indicate the developer has mis-identified the declaration
45444530 // they want to check (or forgot to import the module weakly).
0 commit comments