periphery
periphery copied to clipboard
False positive with dictionary key
Hello,
With the following code:
class Foo {
private let key = "the-key"
func run() {
var dictionary: [String: Any] = [:]
dictionary[key] = 42 // <-- `key` is used there!
print(dictionary.count)
}
}
Foo().run()
Periphery 2.8.1 reports:
warning: Property 'key' is assigned, but never used
Note: If I add key in the print(...) statement, the warning disappears.
It looks like https://bugs.swift.org/browse/SR-14162 but here it's not a static property.
Yep, that's the same issue. I'm planning to try fix this issue myself, in time for Swift 5.6... but I've hardly any time recently for Periphery.