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

unused_capture_list false positive with explicit capturing of unowned self in Swift 5.3 #3389

Closed
2 tasks done
lordzsolt opened this issue Oct 20, 2020 · 0 comments · Fixed by #3392
Closed
2 tasks done

Comments

@lordzsolt
Copy link
Contributor

lordzsolt commented Oct 20, 2020

New Issue Checklist

Describe the bug

Same issue as #3267 but with unowned instead of strong.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint Example.swift --no-cache                   
Linting Swift files at paths Example.swift
Linting 'Example.swift' (1/1)
Example.swift:14:50: warning: Unused Capture List Violation: Unused reference self in a capture list should be removed. (unused_capture_list)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.40.3

  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Cocoapods

  • Paste your configuration file: none, unused_capture_list is enabled by default

  • Are you using nested configurations? No

  • Which Xcode version are you using (check xcodebuild -version)? Xcode 12.2 Beta

  • Do you have a sample that shows the issue?

override func viewDidLoad() {
	super.viewDidLoad() {
		rx.onViewDidAppear.subscribe(onNext: { [unowned self] in 
			doSomething()
		}).disposed(by: disposeBag)
	}

	func doSomething() {
		print("Watch this")
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant