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 import false-positive for module that provides a conformance #805

Open
ileitch opened this issue Aug 23, 2024 · 0 comments
Open

Unused import false-positive for module that provides a conformance #805

ileitch opened this issue Aug 23, 2024 · 0 comments
Labels
bug A bug in Periphery

Comments

@ileitch
Copy link
Contributor

ileitch commented Aug 23, 2024

When a file does not reference any declarations in a given module, but that module does provide a conformance that is required in the file, the import removal can result in a build failure. For example:

A/a.swift:

class Foo {}

B/b.swift:

import A

extension Foo: SomeProtocol {
  var someProperty: Int
}

C/c.swift:

import B

func someMethod(_ thing: SomeProtocol) {}

D/d.swift:

import A
import B // unused, yet required because it conforms Foo to SomeProtocol
import C

someMethod(Foo())
@ileitch ileitch added this to the v3 milestone Aug 23, 2024
@ileitch ileitch added the bug A bug in Periphery label Dec 18, 2024
@ileitch ileitch removed this from the v3 milestone Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in Periphery
Projects
None yet
Development

No branches or pull requests

1 participant