periphery icon indicating copy to clipboard operation
periphery copied to clipboard

Enum cases reported as assigned but unused

Open aisohaikens opened this issue 5 years ago • 2 comments

enum Foo {
    static let foo = "foo"
}

class Bar {
    func bar() -> [String: Int] {
        var s: [String: Int] = [:]
        s[Foo.foo] = 3
        return s
    }
}

let b = Bar()
print(b.bar())

gives me

main.swift:2:16: warning: Property 'foo' is assigned, but never used

This file is a member of the target I pass to --targets. swift version is 5.3.1 Also happens with swift version 5.3.2. I'm using periphery 2.4.1 (latest)

aisohaikens avatar Jan 11 '21 12:01 aisohaikens

Unfortunately this appears to be caused by a bug in Swift that I cannot workaround: https://bugs.swift.org/browse/SR-14162

ileitch avatar Feb 07 '21 12:02 ileitch

Thanks for investigating!

aisohaikens avatar Feb 08 '21 08:02 aisohaikens

Unfortunately, I needed to close this issue because it was created with a company account and that account will be erased shortly. I have raised a new one with my personal account. Sorry for any inconvenience.

aisohaikens avatar Dec 21 '22 15:12 aisohaikens