Skip to content

Commit 1720799

Browse files
committed
[Changelog] Adds an entry for SR-8974
1 parent 9ae2c85 commit 1720799

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,28 @@ CHANGELOG
2626
Swift Next
2727
----------
2828

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+
2951
* [SR-6118][]:
3052

3153
Subscripts can now declare default arguments:
@@ -7696,5 +7718,6 @@ Swift 1.0
76967718
[SR-7799]: <https://bugs.swift.org/browse/SR-7799>
76977719
[SR-8109]: <https://bugs.swift.org/browse/SR-8109>
76987720
[SR-8546]: <https://bugs.swift.org/browse/SR-8546>
7721+
[SR-8974]: <https://bugs.swift.org/browse/SR-8974>
76997722
[SR-9043]: <https://bugs.swift.org/browse/SR-9043>
77007723
[SR-9827]: <https://bugs.swift.org/browse/SR-9827>

0 commit comments

Comments
 (0)