-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #484 from braxtonhall/or-else
OrElse callback should be able to change Ok type
- Loading branch information
Showing
5 changed files
with
122 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
'neverthrow': major | ||
--- | ||
|
||
Allow orElse method to change ok types. | ||
This makes the orElse types match the implementation. | ||
|
||
This is a breaking change for the orElse type argument list, | ||
as the ok type must now be provided before the err type. | ||
|
||
```diff | ||
- result.orElse<ErrType>(foo) | ||
+ result.orElse<OkType, ErrType>(foo) | ||
``` | ||
|
||
This only applies if type arguments were | ||
explicitly provided at an orElse callsite. | ||
If the type arguments were inferred, | ||
no updates are needed during the upgrade. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters