File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,25 @@ CHANGELOG
24
24
Swift 5.0
25
25
---------
26
26
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
+
27
46
* Swift 3 mode has been removed. Supported values for the ` -swift-version `
28
47
flag are ` 4 ` , ` 4.2 ` , and ` 5 ` .
29
48
@@ -7406,6 +7425,7 @@ Swift 1.0
7406
7425
[SE- 0227 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0227-identity-keypath.md>
7407
7426
[SE- 0228 ]: < https: // github.com/apple/swift-evolution/blob/master/proposals/0228-fix-expressiblebystringinterpolation.md>
7408
7427
[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>
7409
7429
7410
7430
[SR- 106 ]: < https: // bugs.swift.org/browse/SR-106>
7411
7431
[SR- 419 ]: < https: // bugs.swift.org/browse/SR-419>
You can’t perform that action at this time.
0 commit comments