Repository navigation
Fix nullability of Network browse results handler arguments - #889
Open
LucaCappelletti94 wants to merge 1 commit into
Open
LucaCappelletti94 wants to merge 1 commit into
LucaCappelletti94 wants to merge 1 commit into
Conversation
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.
nw_browser_browse_results_changed_handler_tsits insideNW_ASSUME_NONNULL_BEGIN, soobjc2-networktyped its old and new results asNonNull<NWBrowseResult>. Network passes NULL as the old result when a service appears and as the new result when it disappears, which is whynw_browse_result_get_changestakes both as_Nullable.I saw it with a Bonjour listener and browser on macOS 26.7.1, iOS 26.6.2 and iPadOS 26.6.2, where every added and removed result handed the closure a NULL
NonNull. I reported the header's annotation to Apple as FB25452730.The translation config had no way to change the nullability of a block typedef's parameters, so
typedef.<name>.arguments.<index>now takes the same overrides as function arguments, and the Network config uses it for the two results. The handler now takes*mut NWBrowseResultfor both. The regenerated file is on theupstream/network-browse-result-nullabilitybranch of myobjc2-generatedfork.This fixes the nullability half only. The typedef still cannot be built from a closure, since its trailing C
boolis notEncodeArgument, the limitation discussed in #752.