Skip to content

Commit 9a2eff1

Browse files
authored
Explicitly require Transferable values for attachments also be Sendable (#1688)
1 parent ee1288d commit 9a2eff1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Sources/Overlays/_Testing_CoreTransferable/Attachments/Attachment+Transferable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extension Attachment {
6161
as contentType: UTType? = nil,
6262
named preferredName: String? = nil,
6363
sourceLocation: SourceLocation = #_sourceLocation
64-
) async throws where T: Transferable, AttachableValue == _AttachableTransferableWrapper<T> {
64+
) async throws where T: Transferable & Sendable, AttachableValue == _AttachableTransferableWrapper<T> {
6565
let transferableWrapper = try await _AttachableTransferableWrapper(exporting: transferableValue, as: contentType)
6666
self.init(transferableWrapper, named: preferredName, sourceLocation: sourceLocation)
6767
}

Sources/Overlays/_Testing_CoreTransferable/Attachments/_AttachableTransferableWrapper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import UniformTypeIdentifiers
2626
/// @Available(Swift, introduced: 6.4)
2727
/// }
2828
@available(_transferableAPI, *)
29-
public struct _AttachableTransferableWrapper<T>: Sendable where T: Transferable {
29+
public struct _AttachableTransferableWrapper<T>: Sendable where T: Transferable & Sendable {
3030
/// The transferable value.
3131
private var _transferableValue: T
3232

0 commit comments

Comments
 (0)