Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redundant_sendable should not apply to protocols #5958

Closed
riley-williams opened this issue Jan 13, 2025 · 0 comments · Fixed by #5959
Closed

redundant_sendable should not apply to protocols #5958

riley-williams opened this issue Jan 13, 2025 · 0 comments · Fixed by #5959
Labels
bug Unexpected and reproducible misbehavior.
Milestone

Comments

@riley-williams
Copy link
Contributor

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
@riley-williams riley-williams changed the title redundant_sendable should not apply to protocols redundant_sendable should not apply to protocols Jan 13, 2025
@SimplyDanny SimplyDanny added this to the 0.58.1 milestone Jan 13, 2025
@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Jan 13, 2025
@SimplyDanny SimplyDanny linked a pull request Jan 13, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants