Merge pull request #268 from ktopley-apple/dispatch-sync-fixup-overlay
Fix warnings in DispatchQueue.sync() implementation when using a comp…
diff --git a/src/swift/Queue.swift b/src/swift/Queue.swift
index b946a80..bff1bc3 100644
--- a/src/swift/Queue.swift
+++ b/src/swift/Queue.swift
@@ -216,11 +216,13 @@
{
var result: T?
var error: Swift.Error?
- fn {
- do {
- result = try work()
- } catch let e {
- error = e
+ withoutActuallyEscaping(work) { _work in
+ fn {
+ do {
+ result = try _work()
+ } catch let e {
+ error = e
+ }
}
}
if let e = error {