Hi all,
I've been looking into an issue where assertionFailure() doesn't respect -assert-config Release when compiled at -Onone. This pull request fixes it by marking the function as @_transparent, ensuring the client's -assert-config is always used.
However, the fix introduces a side effect: since the body is now inlined into the caller, the compiler's reachability analysis sees assertionFailure() as noreturn or not depending on the active -assert-config. This means code that compiles cleanly in Debug may produce a "missing return" error in Release. The same issue also applies to assert(). Here's an example demonstrating the behavior.
One alternative I've been exploring is using @export(implementation) @inline(__always) instead of @_transparent. This also emits the function body into the client (so -assert-config is respected), but doesn't expose the internals to reachability analysis. The downside is that @export(implementation) no longer emits the symbol into the dylib, which would break the stdlib's ABI. And I couldn't fix that with @abi/@_silgen_name.
I'd appreciate any guidance on the right approach here. Thank you!