mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
swift-foundation recently landed a change (in swiftlang/swift-foundation#764) which requires `any Sendable` values in `JSONEncoder.userInfo`. This causes a build failure: ``` JSONRPCConnection.swift:370:50: error: type '(RequestID) -> Optional<any ResponseType.Type>' does not conform to the 'Sendable' protocol 368 | 369 | // Setup callback for response type. 370 | decoder.userInfo[.responseTypeCallbackKey] = { (id: RequestID) -> ResponseType.Type? in | |- error: type '(RequestID) -> Optional<any ResponseType.Type>' does not conform to the 'Sendable' protocol | `- note: a function type must be marked '@Sendable' to conform to 'Sendable' 371 | guard let outstanding = self.outstandingRequests[id] else { 372 | logger.error("Unknown request for \(id, privacy: .public)") ``` Make the closure sendable, which is safe as we're only reading from `outstandingRequests` (where all our writes are guarded by the same queue that the decoding is on).
5.7 KiB
5.7 KiB