Modernize Swift assertion behavior and optional helper APIs - #25
Open
jjamminjim wants to merge 16 commits into
Open
Modernize Swift assertion behavior and optional helper APIs#25jjamminjim wants to merge 16 commits into
jjamminjim wants to merge 16 commits into
Conversation
added 16 commits
March 5, 2026 21:49
…-modernization-pass
Contributor
Author
|
@pjvea : Hope this finds you well. Let me know if you have any questions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR modernizes the Swift-side debugging and assertion utilities while preserving the package vocabulary and the existing Objective-C bridge surface.
What Changed
informandinformIfactive in all build configurations and added a swappableDBCLoggerprotocol withDBCDebugPrintLoggeras the default implementationcheck,ensure, and related failure helpers so release builds log throughinform, while debug builds retain the existing assertion behavior and fallback logging when intensity suppresses a debug assertionAssertionsclosures to delegate directly to Swift assertion primitives instead of raisingNSExceptionfirstDBCOptionalErrorfor the throwing Optional helpers, improved Objective-CNSErrorbridging metadata, and tightened error/log formattingBehavior Notes
Assertions.*performIfDBCIntensity,inform, andinformIfnow honor intensity in all builds rather than compiling out in releasecheckandensurestill surface failures throughinformwhen debug assertions are suppressed by intensityTesting
swift testswift test -c releaseswift test --filter SwiftDBCTestsswift test --filter SwiftDBCBridgedTestsswift test --filter RequiredOptionalTestsswift test -c release --filter SwiftDBCTestsswift test -c release --filter RequiredOptionalTestsNotes
RequiredOptionalTests.swiftstill emits existing XCTest warnings about#fileIDvs#filePath; that warning predates the PR finalization and was left out of scope for this change set.