Change keypath BindingTarget.init to solve source breaking change in SE-0481 #890
Merged
mluisbrown merged 1 commit intomasterfrom Jun 29, 2025
Merged
Conversation
ReferenceWritableKeyPath instead of a WritableKeyPath in order to resolve source breaking change in SE-0481.
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a source-breaking issue with SE-0481 by changing the key path type in the BindingTarget initializer.
- Updated the initializer to use ReferenceWritableKeyPath instead of WritableKeyPath.
- The change ensures that the key path parameter is appropriate for object reference types.
Comments suppressed due to low confidence (1)
Sources/UnidirectionalBinding.swift:188
- Update the documentation comment to indicate that the keyPath parameter now expects a ReferenceWritableKeyPath to match the new API signature.
public init<Object: AnyObject>(on scheduler: Scheduler = ImmediateScheduler(), lifetime: Lifetime, object: Object, keyPath: ReferenceWritableKeyPath<Object, Value>) {
RuiAAPeres
approved these changes
Jun 29, 2025
mluisbrown
added a commit
that referenced
this pull request
Jun 29, 2025
Updated with change from #890
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.
Fixes: #889
SE-0481 would break the current version of the
BindingTarget.initthat takes a keypath. Changing the keypath type fromWritableKeyPathtoReferenceWritableKeyPathfixes this, and is probably what the type should always have been, sinceObjectwill always be a reference type.Despite the signature of the initalizer changing, this is unlikely to break existing code using it, as the keypath is almost always passed using keypath notation (eg :
\.property) and not using an explicit keypath type.Checklist