-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Stub out new KeyPath APIs in NSSortDescriptor #1120
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
Conversation
@swift-ci test and merge |
@@ -35,10 +35,13 @@ open class NSSortDescriptor: NSObject, NSSecureCoding, NSCopying { | |||
|
|||
open var key: String? { NSUnimplemented() } | |||
open var ascending: Bool { NSUnimplemented() } | |||
var keyPath: AnyKeyPath? { NSUnimplemented() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be open
.
|
||
open func allowEvaluation() { NSUnimplemented() } // Force a sort descriptor which was securely decoded to allow evaluation | ||
|
||
public init(key: String?, ascending: Bool, comparator cmptr: Comparator) { NSUnimplemented() } | ||
convenience init<Root, Value>(keyPath: KeyPath<Root, Value>, ascending: Bool) { NSUnimplemented() } | ||
convenience init<Root, Value>(keyPath: KeyPath<Root, Value>, ascending: Bool, comparator cmptr: @escaping Comparator) { NSUnimplemented() } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be public
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the declaration directly from here
Are we saying this is incorrect or that it's common practice to replace convenience with public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we saying this is incorrect or that it's common practice to replace convenience with public?
Actually incorrect 🙂 convenience
is not an access control specifier.
The symblos in the API documents are all public
(or open
). If you don't specify any access control it defaluts to internal
visibility so consumers of the framework can't see those symbols.
You should check the documents:
- https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/AccessControl.html#//apple_ref/doc/uid/TP40014097-CH41-ID7
- https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/Initialization.html#//apple_ref/doc/uid/TP40014097-CH18-ID217
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thanks for taking the time to explain that :)
I'll update shortly with the correct access controls, I'll also have a read through the documentation you've provided.
Thanks again! :)
There are new KeyPath APIs in
NSSortDescriptor
which needed stubbing out in swift-corelibs-foundation. This PR adds those stubs using the declarations found here