Skip to content

Commit 860bb79

Browse files
authored
Merge pull request #22103 from jshier/result-changelog-entry
2 parents 383ec4a + 9a43ed4 commit 860bb79

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@ CHANGELOG
2424
Swift 5.0
2525
---------
2626

27+
* [SE-0235][]:
28+
29+
The standard library now contains a `Result` type for manually propagating errors.
30+
31+
```swift
32+
enum Result<Success, Failure: Error> {
33+
case success(Success)
34+
case failure(Failure)
35+
}
36+
```
37+
38+
This type serves a complementary role to that of throwing functions and initializers.
39+
Use `Result` in situations where automatic error propagation or `try`-`catch`
40+
blocks are undesirable, such as in asynchronous code or when accumulating the
41+
results of successive error-producing operations.
42+
43+
* `Error` now conforms to itself. This allows for the use of `Error` itself as
44+
the argument for a generic parameter constrained to `Error`.
45+
2746
* Swift 3 mode has been removed. Supported values for the `-swift-version`
2847
flag are `4`, `4.2`, and `5`.
2948

@@ -7406,6 +7425,7 @@ Swift 1.0
74067425
[SE-0227]: <https://github.com/apple/swift-evolution/blob/master/proposals/0227-identity-keypath.md>
74077426
[SE-0228]: <https://github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
74087427
[SE-0230]: <https://github.com/apple/swift-evolution/blob/master/proposals/0230-flatten-optional-try.md>
7428+
[SE-O235]: <https://github.com/apple/swift-evolution/blob/master/proposals/0235-add-result.md>
74097429

74107430
[SR-106]: <https://bugs.swift.org/browse/SR-106>
74117431
[SR-419]: <https://bugs.swift.org/browse/SR-419>

0 commit comments

Comments
 (0)