Skip to content

Commit 0f353ae

Browse files
committed
NFC: Update CHANGELOG to mention that @autoclosure forwarding is disabled in Swift >= 5
(cherry picked from commit 160aed9)
1 parent ee39236 commit 0f353ae

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ CHANGELOG
2323

2424
Swift 5.0
2525
---------
26+
* [SR-5719][]:
27+
28+
Starting from `-swift-version 5`, implicit `@autoclosure` function type
29+
forwarding has been disabled, and new a diagnostic has been added suggesting
30+
to add `()` to call the function value in such case. The call itself would be
31+
wrapped in an implicit closure and passed to the corresponding parameter.
32+
33+
Example:
34+
35+
```swift
36+
func foo(_ fn: @autoclosure () -> Int) {}
37+
func bar(_ fn: @autoclosure () -> Int) {
38+
foo(fn) // Incorrect, `fn` can't be forwarded and has to be called
39+
foo(fn()) // Ok
40+
}
41+
```
2642

2743
* [SR-7139][]:
2844

@@ -7306,3 +7322,4 @@ Swift 1.0
73067322
[SR-4248]: <https://bugs.swift.org/browse/SR-4248>
73077323
[SR-7139]: <https://bugs.swift.org/browse/SR-7139>
73087324
[SR-7251]: <https://bugs.swift.org/browse/SR-7251>
7325+
[SR-5719]: <https://bugs.swift.org/browse/SR-5719>

0 commit comments

Comments
 (0)