File tree 2 files changed +14
-3
lines changed
Source/SourceKittenFramework
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,11 @@ public final class SourceKitObject {
110
110
}
111
111
112
112
func sendAsync( ) async throws -> sourcekitd_response_t {
113
- let handle = UnsafeMutablePointer< sourcekitd_request_handle_t?> . allocate( capacity: 1 )
113
+ let handle = UncheckedSendable ( UnsafeMutablePointer< sourcekitd_request_handle_t?> . allocate( capacity: 1 ) )
114
114
115
115
return try await withTaskCancellationHandler {
116
116
try await withUnsafeThrowingContinuation { continuation in
117
- sourcekitd_send_request ( sourcekitdObject, handle) { response in
117
+ sourcekitd_send_request ( sourcekitdObject, handle. value ) { response in
118
118
enum SourceKitSendError : Error { case error, noResponse }
119
119
120
120
guard let response else {
@@ -130,7 +130,7 @@ public final class SourceKitObject {
130
130
}
131
131
}
132
132
} onCancel: {
133
- sourcekitd_cancel_request ( handle)
133
+ sourcekitd_cancel_request ( handle. value )
134
134
}
135
135
}
136
136
}
Original file line number Diff line number Diff line change
1
+ struct UncheckedSendable < Value> : @unchecked Sendable {
2
+ /// The unchecked value.
3
+ var value : Value
4
+
5
+ /// Initializes unchecked sendability around a value.
6
+ ///
7
+ /// - Parameter value: A value to make sendable in an unchecked way.
8
+ init ( _ value: Value ) {
9
+ self . value = value
10
+ }
11
+ }
You can’t perform that action at this time.
0 commit comments