-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
unused_setter_value
incorrectly triggers for overridden properties.
#2585
Comments
Yeah I agree we should allow no-op |
Note: you can silence the warning: override var selectedTextRange: UITextRange? {
get { return nil }
set { _ = newValue }
} |
That's a good workaround for now @marcelofabri although I think we should also implement this change because users shouldn't adapt their code just to satisfy SwiftLint unless it's also better for other reasons. I think in this case, an empty |
yeah, but this will be a warning on Swift too soon: swiftlang/swift#21983 and https://bugs.swift.org/browse/SR-964 I don't mind changing the behavior though, so PRs are welcome! |
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions! |
This change appears nice, but it would be good to have an option (attribute?) to allow enforcing this rule on |
New Issue Checklist
Describe the bug
unused_setter_value
incorrectly triggers for overridden properties.I use the following code that I gave as a Stack Overflow answer:
Having an empty setter is the desired behavior when overriding.
Environment
The text was updated successfully, but these errors were encountered: