Unused Capture List Violation: Unused reference self when self only used in guard let #4804
Closed
2 tasks done
Labels
bug
Unexpected and reproducible misbehavior.
New Issue Checklist
Describe the bug
If a closure uses [weak self] and it's only use of self is to guard let self then it still warns that self is not used. This use of guard let self allows subsequent code in the block to not require prefixing with self. But this makes SwiftLint think self is not used.
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint MyFile.swift warning: Unused Capture List Violation: Unused reference self in a capture list should be removed. (unused_capture_list)
Environment
swiftlint version
to be sure)? 0.50.3xcodebuild -version
)? Running standalone.The text was updated successfully, but these errors were encountered: