Skip to content

Add ! operator overloading for the result types. #261

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

Merged
merged 1 commit into from
Apr 21, 2025
Merged

Conversation

Dixin
Copy link
Contributor

@Dixin Dixin commented Apr 17, 2025

Currently the result type supports if (result) { }. https://dotnet.github.io/dotNext/features/core/result.html

However, if (!result) { } does not work.

Add the ! operator overloading for Result<T> and Result<T, TError> to support if (!result) { }.

@Dixin
Copy link
Contributor Author

Dixin commented Apr 17, 2025

The failed checks are not related to the committed code changes.

The command could not be loaded, possibly because:
  * You intended to execute a .NET application:
      The application 'restore' does not exist.
  * You intended to execute a .NET SDK command:
      A compatible .NET SDK was not found.

##[error]Error: The process '/usr/bin/dotnet' failed with exit code 145
##[error]Packages failed to restore

@Dixin Dixin changed the title Result Add ! operator overloading for the result type. Apr 17, 2025
@Dixin Dixin changed the title Add ! operator overloading for the result type. Add ! operator overloading for the result types. Apr 17, 2025
@sakno sakno self-assigned this Apr 18, 2025
@sakno
Copy link
Collaborator

sakno commented Apr 18, 2025

Please change the target branch to develop.

@Dixin Dixin changed the base branch from master to develop April 19, 2025 05:31
@sakno
Copy link
Collaborator

sakno commented Apr 19, 2025

Changing from master to develop is not enough. This happens because master always has squashed commits. To fix it, you need to create a branch from develop, cherry-pick your changes, then force-push to the remote branch associated with this PR.

@Dixin
Copy link
Contributor Author

Dixin commented Apr 21, 2025

@sakno

Changing from master to develop is not enough. This happens because master always has squashed commits. To fix it, you need to create a branch from develop, cherry-pick your changes, then force-push to the remote branch associated with this PR.

Thank you for the help. It is done.

@sakno sakno merged commit 06addcd into dotnet:develop Apr 21, 2025
3 of 5 checks passed
@sakno
Copy link
Collaborator

sakno commented Apr 21, 2025

Thanks for your contribution!

@Dixin Dixin deleted the result branch April 26, 2025 21:11
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.

2 participants