I've seen a lot of times people using the variable name instead of newValue which leads to bugs:
var aValue: String {
get {
return Persister.shared.aValue
}
set {
Perister.shared.aValue = aValue //should be newValue
}
}
A small detail here is that you can use another name for the parameter. For example:
// shouldn't trigger
var aValue: String {
get {
return Persister.shared.aValue
}
set(persistedValue) {
Perister.shared.aValue = persistedValue
}
}
There's an open ticket on Swift JIRA for this as well: SR-964
Closing this as https://github.com/apple/swift/pull/11465 was merged and it'll be a compiler warning in future Swift versions 馃帀
Note that a case was missed in the resolution to SR-964, and the PR for the fix never ended up getting merged, so SwiftLint could still provide a band-aid (or anyone who's interested could pick up that PR and port it to Swift 4.2 or 5.0).
Going to revive this because we're just bitten by it, so I guess the compiler warning never really shipped on 4.2
Would it be possible to ignore properties that are marked as unavailable? This is a bit unfortunate.

@jgavris please open a new issue to track this
Most helpful comment
Closing this as https://github.com/apple/swift/pull/11465 was merged and it'll be a compiler warning in future Swift versions 馃帀