RxSwift icon indicating copy to clipboard operation
RxSwift copied to clipboard

Fix Swift 6.2 weak mutability warning in Binder

Open kirillyakimovich opened this issue 1 month ago • 0 comments

Introduction of weak let additionally added new checks, so the existing pattern warns that weakTarget will never have new value assigned by programmer.

Switching to capture list to get rid of the warning.

Redacted diagnostics message:

..RxSwift/Binder.swift:29:18: weak variable 'weakTarget' was never mutated; consider changing to 'let' constant [#]8;;https://docs.swift.org/compiler/documentation/diagnostics/weak-mutability\WeakMutability]8;;\]

Link is broken, and not able to find related article (yet?).

kirillyakimovich avatar Dec 04 '25 19:12 kirillyakimovich