-
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
I have trailing_closure where is not #5150
Comments
The rule complains about the closure argument of the The rule, therefore, is correct but the trigger location should be improved to be the method with the closure argument itself. |
But |
How is |
|
In this case, it's really a bug in the rule. Using a trailing closure would not compile or lead to semantical changes which is not okay. However, since this rule operators on syntax-level without type information and, in your case, function signature information only, it cannot do better. We have to live with such false positives if the rule shall at the same time be very fast, unfortunately. SwiftLint also offers so called "Analyzer Rules" which have a deeper knowledge about types and exact signatures. They are very slow and a separate SwiftLint run is required, on the other hand. |
New Issue Checklist
Describe the bug
The code has no closure as an argument, so the trailing closure syntax cannot be applied.
Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)? 👉 0.52.4xcodebuild -version
)? 👇The text was updated successfully, but these errors were encountered: