File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
## Swift 6.0
7
7
8
+ * [ SE-0432] [ ] :
9
+ Noncopyable enums can be pattern-matched with switches without consuming the
10
+ value you switch over:
11
+
12
+ ``` swift
13
+ enum Lunch : ~ Copyable {
14
+ case soup
15
+ case salad
16
+ case sandwich
17
+ }
18
+
19
+ func isSoup (_ lunch : borrowing Lunch) -> Bool {
20
+ switch lunch {
21
+ case .soup : true
22
+ default : false
23
+ }
24
+ }
25
+ ```
26
+
27
+
8
28
* [ SE-0429] [ ] :
9
29
Certain types that contain noncopyable fields, such as those without a deinit,
10
30
can now be consumed field-by-field:
@@ -10307,6 +10327,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
10307
10327
[SE- 0422 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0422-caller-side-default-argument-macro-expression.md
10308
10328
[SE- 0427 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0427-noncopyable-generics.md
10309
10329
[SE- 0429 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0429-partial-consumption.md
10330
+ [SE- 0432 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0432-noncopyable-switch.md
10310
10331
[#64927 ]: < https: // github.com/apple/swift/issues/64927>
10311
10332
[#42697 ]: < https: // github.com/apple/swift/issues/42697>
10312
10333
[#42728 ]: < https: // github.com/apple/swift/issues/42728>
You can’t perform that action at this time.
0 commit comments