File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,28 @@ CHANGELOG
26
26
Swift Next
27
27
----------
28
28
29
+ * [ SR-8974] [ ] :
30
+
31
+ Duplicate tuple element labels are no longer allowed, as they lead to
32
+ undefined behavior. For example:
33
+
34
+ ```
35
+ let dupLabels: (foo: Int, foo: Int) = (foo: 1, foo: 2)
36
+
37
+ enum Foo { case bar(x: Int, x: Int) }
38
+ let f: Foo = .bar(x: 0, x: 1)
39
+ ```
40
+
41
+ will now be diagnosed as an error.
42
+
43
+ Note: You can still use duplicate labels when declaring functions and
44
+ subscripts, as long as the internal labels are different. For example:
45
+
46
+ ```
47
+ func foo(bar x: Int, bar y: Int) {}
48
+ subscript(a x: Int, a y: Int) -> Int {}
49
+ ```
50
+
29
51
* [ SR-6118] [ ] :
30
52
31
53
Subscripts can now declare default arguments:
@@ -7696,5 +7718,6 @@ Swift 1.0
7696
7718
[SR- 7799 ]: < https: // bugs.swift.org/browse/SR-7799>
7697
7719
[SR- 8109 ]: < https: // bugs.swift.org/browse/SR-8109>
7698
7720
[SR- 8546 ]: < https: // bugs.swift.org/browse/SR-8546>
7721
+ [SR- 8974 ]: < https: // bugs.swift.org/browse/SR-8974>
7699
7722
[SR- 9043 ]: < https: // bugs.swift.org/browse/SR-9043>
7700
7723
[SR- 9827 ]: < https: // bugs.swift.org/browse/SR-9827>
You can’t perform that action at this time.
0 commit comments