From be681c12e3a4f4bec91d32c1995840160fe5486d Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Fri, 14 Oct 2022 16:41:25 +0100 Subject: [PATCH] Remove `Sendable` constraint for `AsyncChain2Sequence` (#213) # Motivation We want to remove any `Sendable` constraints on iterators since they ought to not be passed between `Task`s. # Modification Explicitly mark the `AsyncChain2Sequence` to be not `Sendable`. # Result Nobody can make this `Sendable`. --- Sources/AsyncAlgorithms/AsyncChain2Sequence.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/AsyncAlgorithms/AsyncChain2Sequence.swift b/Sources/AsyncAlgorithms/AsyncChain2Sequence.swift index 59d3cfe..3e9b4c4 100644 --- a/Sources/AsyncAlgorithms/AsyncChain2Sequence.swift +++ b/Sources/AsyncAlgorithms/AsyncChain2Sequence.swift @@ -80,4 +80,6 @@ extension AsyncChain2Sequence: AsyncSequence { } extension AsyncChain2Sequence: Sendable where Base1: Sendable, Base2: Sendable { } -extension AsyncChain2Sequence.Iterator: Sendable where Base1.AsyncIterator: Sendable, Base2.AsyncIterator: Sendable { } + +@available(*, unavailable) +extension AsyncChain2Sequence.Iterator: Sendable { }