We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ae1c3f commit 68a4b31Copy full SHA for 68a4b31
test/Concurrency/isolated_parameters.swift
@@ -319,3 +319,17 @@ func isolatedClosures() {
319
a.f()
320
}
321
322
+
323
+// Test case for https://github.com/apple/swift/issues/62568
324
+func execute<ActorType: Actor>(
325
+ on isolatedActor: isolated ActorType,
326
+ task: @escaping @Sendable (isolated ActorType) -> Void)
327
+{
328
+ // Compiler correctly allows this task to execute synchronously.
329
+ task(isolatedActor)
330
+ // Start a task that inherits the current execution context (i.e. that of the isolatedActor)
331
+ Task {
332
+ // 'await' is not not necessary because 'task' is synchronous.
333
334
+ }
335
+}
0 commit comments