Skip to content

Commit 18c1d98

Browse files
committed
Add future direction
1 parent 4f55c8f commit 18c1d98

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

proposals/testing/0012-exit-test-value-capturing.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,18 @@ them.
204204
C23, in which case we should be able to use it and avoid the need for explicit
205205
types in the capture list. ([rdar://153389205](rdar://153389205))
206206

207+
- Explicitly marking the body closure as requiring explicit captures
208+
209+
Currently, if the body closure implicitly captures a value, the diagnostic the
210+
compiler provides is a bit opaque:
211+
212+
> 🛑 A C function pointer cannot be formed from a closure that captures context
213+
214+
In the future, it may be possible to annotate the body closure with an
215+
attribute, keyword, or other decoration that tells the compiler we need an
216+
explicit capture list, which would allow it to provide a clearer diagnostic if
217+
a value is implicitly captured.
218+
207219
- Supporting capturing values that do not conform to `Codable`
208220

209221
Alternatives to `Codable` exist or have been proposed, such as

0 commit comments

Comments
 (0)