Skip to content

Capture of non-Sendable type AsyncIterator.Type warning #82905

Closed
@vanvoorden

Description

@vanvoorden

Description

Potential compiler bug… looks like this should not be a warning.

https://forums.swift.org/t/capture-of-non-sendable-type-concurrency-warning-from-asyncsequence-asynciterator/80379

#82116 (comment)

Reproduction

func f<S>(_ s: S) throws
where S: AsyncSequence & Sendable {
  Task {
    for try await i in s {
//                     ^ Capture of non-sendable type 'S.AsyncIterator.Type' in an isolated closure
    }
  }
}

Environment

swift-driver version: 1.127.5.3 Apple Swift version 6.2 (swiftlang-6.2.0.10.950 clang-1700.3.10.950)
Target: arm64-apple-macosx15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions