Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-4397] #keyPath(...) incorrectly resolves paths for Operation state properties #46976

Open
swift-ci opened this issue Mar 28, 2017 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-4397
Radar rdar://problem/30243087
Original Reporter vkovtash (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 1
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 84cb0bb951e9fb92a43bbd0b31a95c20

is duplicated by:

  • SR-4522 #keyPath broken for isFinished property of Operation in Swift 3.1

Issue Description:

Since swift 3.1 custom implementations of isReady (and other properties I believe) using #keyPath are completely broken.

Sending does nothing willChangeValue(forKey: #keyPath(isReady)) and didChangeValue(forKey: #keyPath(isReady)). Operation will never start.

OperationQueue observes "isReady" and #keyPath(isReady) resolves it to "ready".

@belkadan
Copy link
Contributor

The problem here is that the Objective-C properties aren't declared to match up with the key that's changed. Current workaround: use a literal string instead.

@swift-ci
Copy link
Collaborator Author

Comment by Ben A (JIRA)

I just ran into this in Swift 4.1. Although in my case, everything appeared to work in iOS 11 but not iOS 10, which might be a difference of SDK release versions in different version of iOS?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants