@@ -4515,21 +4515,6 @@ static bool diagnoseHasSymbolCondition(PoundHasSymbolInfo *info,
4515
4515
return true ;
4516
4516
}
4517
4517
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
-
4533
4518
auto decl = info->getReferencedDecl ().getDecl ();
4534
4519
if (!decl) {
4535
4520
// Diagnose because we weren't able to interpret the expression as one
@@ -4538,7 +4523,8 @@ static bool diagnoseHasSymbolCondition(PoundHasSymbolInfo *info,
4538
4523
return true ;
4539
4524
}
4540
4525
4541
- if (!decl->isWeakImported (DC->getParentModule ())) {
4526
+ if (DC->getFragileFunctionKind ().kind == FragileFunctionKind::None &&
4527
+ !decl->isWeakImported (DC->getParentModule ())) {
4542
4528
// `if #_hasSymbol(someStronglyLinkedSymbol)` is functionally a no-op
4543
4529
// and may indicate the developer has mis-identified the declaration
4544
4530
// they want to check (or forgot to import the module weakly).
0 commit comments