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-12930] Add protocol extension to "Result where Success == Void" so that we can use .success() #55376

Open
swift-ci opened this issue Jun 3, 2020 · 2 comments
Labels
good first issue Good for newcomers improvement standard library Area: Standard library umbrella swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jun 3, 2020

Previous ID SR-12930
Radar None
Original Reporter ronyfadel (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement, StarterProposal
Assignee None
Priority Medium

md5: 176bf2fbbef4e6b7e54e92d66bdb68aa

Issue Description:

Currently, to signal a success of type Result<Void, Swift.Error>, we need to use:

.success(())

Combine, for example, special-cases Subject for when the Output is of type Void:

extension Subject where Self.Output == Void {
    /// Signals subscribers.
    public func send()
}

A similar extension could be added for `Result` so that we can use .success(()) instead:

extension Result where Success == Void {
    static func success() -> Self {
        return .success(())
    }
}
 

I'd be happy to contribute a patch if someone can point me to the proper PR policy.

@theblixguy
Copy link
Collaborator

There are several pitches (such as this) on the Swift forums (including a implementation PR here) which I think would be good to take a look at first.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added good first issue Good for newcomers swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal and removed StarterProposal labels Nov 11, 2022
@XaurDesu
Copy link

It seems as if the implementation PR has been closed, should this issue be worked on at the moment?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers improvement standard library Area: Standard library umbrella swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal
Projects
None yet
Development

No branches or pull requests

4 participants