From 98d634aa943601e40f0a39c707e512d9bbd31ca6 Mon Sep 17 00:00:00 2001 From: George Barnett Date: Mon, 3 Feb 2025 16:34:43 +0000 Subject: [PATCH] Workaround nightly compiler crash Motivation: Nightly toolchains are crashing when compiling this project. This is tracked in https://github.com/swiftlang/swift/issues/78112 Modifications: - Add extra type info as this appears to work around the crash. Result: CI green on nightly toolchains. --- .../GRPCNIOTransportCore/Client/Connection/GRPCChannel.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/GRPCNIOTransportCore/Client/Connection/GRPCChannel.swift b/Sources/GRPCNIOTransportCore/Client/Connection/GRPCChannel.swift index eb8254e..10a9649 100644 --- a/Sources/GRPCNIOTransportCore/Client/Connection/GRPCChannel.swift +++ b/Sources/GRPCNIOTransportCore/Client/Connection/GRPCChannel.swift @@ -339,7 +339,8 @@ extension GRPCChannel { return } - let (enqueued, loadBalancer) = self.state.withLock { state in + // Explicitly adding the types works around: https://github.com/swiftlang/swift/issues/78112 + let (enqueued, loadBalancer) = self.state.withLock { state -> (Bool, LoadBalancer?) in state.enqueue(continuation: continuation, waitForReady: waitForReady, id: id) }