Skip to content

Commit 39e10f9

Browse files
authored
Merge pull request #2884 from swiftlang/jgrynspan/exit-tests-convention-change
[TWG] Tweak the calling convention of exit test closures.
2 parents b79d694 + e481b32 commit 39e10f9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

proposals/testing/0008-exit-tests.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ the testing library:
177177
observing observedValues: [any PartialKeyPath<ExitTest.Result> & Sendable] = [],
178178
_ comment: @autoclosure () -> Comment? = nil,
179179
sourceLocation: SourceLocation = #_sourceLocation,
180-
performing expression: @convention(thin) () async throws -> Void
180+
performing expression: @escaping @Sendable () async throws -> Void
181181
) -> ExitTest.Result? = #externalMacro(module: "TestingMacros", type: "ExitTestExpectMacro")
182182

183183
/// Check that an expression causes the process to terminate in a given fashion
@@ -193,7 +193,7 @@ the testing library:
193193
observing observedValues: [any PartialKeyPath<ExitTest.Result> & Sendable] = [],
194194
_ comment: @autoclosure () -> Comment? = nil,
195195
sourceLocation: SourceLocation = #_sourceLocation,
196-
performing expression: @convention(thin) () async throws -> Void
196+
performing expression: @escaping @Sendable () async throws -> Void
197197
) -> ExitTest.Result = #externalMacro(module: "TestingMacros", type: "ExitTestRequireMacro")
198198
```
199199

@@ -464,8 +464,8 @@ in:
464464
There are some constraints on valid exit tests:
465465

466466
1. Because exit tests are run in child processes, they cannot capture any state
467-
from the calling context (hence their body closures are `@convention(thin)`
468-
or `@convention(c)`.) See the **Future directions** for further discussion.
467+
from the calling context. See the **Future directions** for further
468+
discussion.
469469
1. Exit tests cannot recursively invoke other exit tests; this is a constraint
470470
that could potentially be lifted in the future, but it would be technically
471471
complex to do so.
@@ -840,7 +840,7 @@ protocol also requires some care to ensure that signal constants such as
840840
observing observedValues: (repeat (KeyPath<ExitTest.Result, each T>)) = (),
841841
_ comment: @autoclosure () -> Comment? = nil,
842842
sourceLocation: SourceLocation = #_sourceLocation,
843-
performing expression: @escaping @Sendable @convention(thin) () async throws -> Void
843+
performing expression: @escaping @Sendable () async throws -> Void
844844
) -> (repeat each T)
845845
```
846846

0 commit comments

Comments
 (0)