-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Labels
enhancementIdeas for improvements of existing features and rules.Ideas for improvements of existing features and rules.good first issueIssue to be taken up by new contributors yet unfamiliar with the project.Issue to be taken up by new contributors yet unfamiliar with the project.
Description
New Issue Checklist
- ✅ I've Updated SwiftLint to the latest version.
- ✅ I've searched for existing GitHub issues.
Bug Description
class_delegate_protocol doesn't recognize the Actor protocol as suitable for being weakly referenced.
protocol FooDelegate: Actor { }
actor Bar {
weak var delegate: (any FooDelegate)? // raises warning: Class Delegate Protocol Violation: Delegate protocols should be class-only so they can be weakly referenced (class_delegate_protocol)
}Since Actor protocol already conforms to AnyObject I believe it can also be whitelisted.
Bonus idea for further consideration: how about renaming the rule into reference_type_delegate_protocol? (I don't have a strong opinion about this one.)
Environment
- SwiftLint version: 0.59.1
- Xcode version: 16.3
- Installation method used: Homebrew
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementIdeas for improvements of existing features and rules.Ideas for improvements of existing features and rules.good first issueIssue to be taken up by new contributors yet unfamiliar with the project.Issue to be taken up by new contributors yet unfamiliar with the project.