Skip to content

Conversation

@kperryua
Copy link
Contributor

A band-aid for incorrect Objective-C API behavior, wherein no NSURL is ever passed to the errorHandler block. This diff extracts the relevant URL from the error and passes that instead. There is already a guarantee that either the URL or path key will be present in the error.

@kperryua
Copy link
Contributor Author

@swift-ci Please test and merge

1 similar comment
@kperryua
Copy link
Contributor Author

@swift-ci Please test and merge

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a reasonable fix. One comment on the API notes.

MethodKind: Instance
- Selector: 'enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:'
MethodKind: Instance
Availability: nonswift
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of Availability: nonswift, please use SwiftPrivate: true. That way it doesn't show up in overload resolution.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good! I'll make that change.

@kperryua
Copy link
Contributor Author

@swift-ci Please test and merge

}

@available(OSX 10.6, iOS 4.0, *)
public func enumerator(at url: URL, includingPropertiesForKeys keys: [URLResourceKey]?, options mask: FileManager.DirectoryEnumerationOptions = [], errorHandler handler: ((URL, Error) -> Bool)? = nil) -> FileManager.DirectoryEnumerator? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry, this should probably be marked final and @nonobjc (per discussion with @parkera).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're going to tackle that later (it would be a source breaking change at this point I believe).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we at least get it right on new methods?

@parkera
Copy link
Contributor

parkera commented Oct 27, 2016

@shahmishal @erg what's going on with this PR? There seem to be plenty of idle nodes available.

@shahmishal
Copy link
Member

@swift-ci Please test and merge

@swift-ci swift-ci merged commit 0bb1fc3 into swiftlang:master Oct 27, 2016
MaxDesiatov pushed a commit that referenced this pull request Sep 7, 2023
[pull] swiftwasm from main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants