Skip to content

redundant_sendable should not apply to protocols #5958

@riley-williams

Description

@riley-williams

Bug Description

Sendable constraints on global-actor-qualified protocols are not redundant.

// This triggers a violation:
@MainActor protocol MyProtocol: Sendable { }

Minimal example showing Sendable is not inferred:

@MainActor protocol NotSend { }

struct S<P: NotSend>: Sendable {
    var p: P // Stored property 'p' of 'Sendable'-conforming generic struct 'S' has non-sendable type 'P'
}

Environment

  • SwiftLint 0.58.0
  • Xcode 16.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnexpected and reproducible misbehavior.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions