mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Concurrency: Guard use of withoutActuallyEscaping() in inlinable code.
Since `withoutActuallyEscaping()` has adopted typed throws, it's no longer visible to older compilers that do not support typed throws. We need to guard use of the function in inlinable code to make sure the textual interface of `_Concurrency` remains buildable with older compilers. Resolves rdar://124352900
This commit is contained in:
@@ -174,12 +174,16 @@ extension DistributedActor {
|
||||
fatalError("Incorrect actor executor assumption; Expected same executor as \(self).", file: file, line: line)
|
||||
}
|
||||
|
||||
#if $TypedThrows
|
||||
// To do the unsafe cast, we have to pretend it's @escaping.
|
||||
return try withoutActuallyEscaping(operation) {
|
||||
(_ fn: @escaping YesActor) throws -> T in
|
||||
let rawFn = unsafeBitCast(fn, to: NoActor.self)
|
||||
return try rawFn(self)
|
||||
}
|
||||
#else
|
||||
fatalError("unsupported compiler")
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user