-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[NSURL] Implementation of '.checkResourceIsReachable' #904
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
…ourceIsReachableAndReturnError' for 'NSURL' to match Darwin's Foundation. 'NSURL' does not throw on darwin by sets the error pointer that is passed in parameter.
Use correct initializer in test
86e26ee
to
086d130
Compare
Foundation/NSURL.swift
Outdated
@@ -610,8 +610,28 @@ open class NSURL : NSObject, NSSecureCoding, NSCopying { | |||
*/ | |||
/// - Experiment: This is a draft API currently under consideration for official import into Foundation as a suitable alternative | |||
/// - Note: Since this API is under consideration it may be either removed or revised in the near future | |||
open func checkResourceIsReachable() throws -> Bool { | |||
NSUnimplemented() | |||
open func checkResourceIsReachableAndReturnError(_ error: UnsafeMutablePointer<NSError?>?) -> Bool { |
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.
Did you put back the error argument here for compatibility with Darwin? There it's an autoreleased error, which we don't have on Linux. For this method I'm ok with the divergent API for now.
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.
Yes, I did it for compatibility with Darwin. I didn't know about the issue (i guess i've just missed it). I'll revert this change.
…ceIsReachable' with throw as Linux does not support Autoreleasing pointers
Updated |
@swift-ci please test and merge |
"ninja: error: unknown target 'swift-benchmark-linux-x86_64" |
@shahmishal @erg do you know what that error means? |
This PR should fix this issue swiftlang/swift#7931 |
@swift-ci please test and merge |
Implemented and renamed method for
NSURL
to match Darwin's version.Added method
. checkResourceIsReachable
toURL
that matches Darwin's Foundation.