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-3705] URL initializer resolvingBookmarkData should not be failable #3893

Closed
tkrajacic opened this issue Jan 24, 2017 · 3 comments
Closed

Comments

@tkrajacic
Copy link

Previous ID SR-3705
Radar None
Original Reporter @tkrajacic
Type Bug
Status Closed
Resolution Done
Environment

macOS 10.12

Additional Detail from JIRA
Votes 1
Component/s Foundation
Labels Bug, SDKOverlay
Assignee None
Priority Medium

md5: 20fe292c9d203212cad1b36b6becae93

Issue Description:

This should not be a failable initializer as the method throws already.
In case there actually is a case where it could NOT throw and still return nil, this should be documented somewhere I guess.

public init?(resolvingBookmarkData data: Data, options: URL.BookmarkResolutionOptions = default, relativeTo url: URL? = default, bookmarkDataIsStale: inout Bool) throws
@lilyball
Copy link
Mannequin

lilyball mannequin commented Jun 21, 2017

It definitely shouldn't be failable. The doc comment for the Obj-C method says that if it returns nil, the error is populated (meaning it can't return nil without throwing an error). And the implementation of the Swift SDK method can't ever return nil.

@lilyball
Copy link
Mannequin

lilyball mannequin commented Jun 21, 2017

I've submitted PR #10435 for this, though I'm not sure if it's going to be accepted since I know the SDK overlays are supposed to be maintained by the respective Apple SDK teams.

@tkrajacic
Copy link
Author

This is fixed in Xcode 10 and Swift 4.2

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant