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 5
5
6
6
## Swift 6.0
7
7
8
+ * [ SE-0429] [ ] :
9
+ Certain types that contain noncopyable fields, such as those without a deinit,
10
+ can now be consumed field-by-field:
11
+
12
+ ``` swift
13
+ struct Token : ~ Copyable {}
14
+
15
+ struct Authentication : ~ Copyable {
16
+ let id: Token
17
+ let name: String
18
+
19
+ mutating func exchange (_ new : consuming Token) -> Token {
20
+ let old = self .id // <- partial consumption of 'self'
21
+ self = .init (id : new, name : self .name )
22
+ return old
23
+ }
24
+ }
25
+ ```
26
+
8
27
* [ SE-0427] [ ] :
9
28
You can now suppress ` Copyable ` on protocols, generic parameters,
10
29
and existentials:
@@ -10287,6 +10306,7 @@ using the `.dynamicType` member to retrieve the type of an expression should mig
10287
10306
[SE- 0413 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0413-typed-throws.md
10288
10307
[SE- 0422 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0422-caller-side-default-argument-macro-expression.md
10289
10308
[SE- 0427 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0427-noncopyable-generics.md
10309
+ [SE- 0429 ]: https: // github.com/apple/swift-evolution/blob/main/proposals/0429-partial-consumption.md
10290
10310
[#64927 ]: < https: // github.com/apple/swift/issues/64927>
10291
10311
[#42697 ]: < https: // github.com/apple/swift/issues/42697>
10292
10312
[#42728 ]: < https: // github.com/apple/swift/issues/42728>
You can’t perform that action at this time.
0 commit comments