Avatar
@swift-5.5.3 import Foundation class C {} _ = AsyncStream(String.self) { continuation in let c = C() continuation.onTermination = { print("\(c)") } } _ = AsyncStream(String.self) { continuation in let c = C() let cushion: @Sendable (AsyncStream<String>.Continuation.Termination) -> Void = { _ in print("\(c)") } continuation.onTermination = cushion } (edited)