Skip to content

Commit 2f22de2

Browse files
committed
Fix warnings in DispatchQueue.sync() implementation when using a compiler with SE-0176 support.
1 parent e591e7e commit 2f22de2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/swift/Queue.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,13 @@ public extension DispatchQueue {
216216
{
217217
var result: T?
218218
var error: Swift.Error?
219-
fn {
220-
do {
221-
result = try work()
222-
} catch let e {
223-
error = e
219+
withoutActuallyEscaping(work) { _work in
220+
fn {
221+
do {
222+
result = try _work()
223+
} catch let e {
224+
error = e
225+
}
224226
}
225227
}
226228
if let e = error {

0 commit comments

Comments
 (0)