Describe the bug
A class implements a protocol method (the method satisfies a protocol requirement). That same method is called on a concrete instance of the class in the app target. At runtime the call runs as expected, but Periphery still reports the method as unused — a false positive. It looks like the tool does not correctly connect protocol witness implementations to call sites on the concrete type (or similar indexing/analysis gap).
Reproduction
- Define a protocol with a method (e.g. build()).
- Implement that method on a conforming class.
- In another file in the same target, create an instance of that class and call the method on that instance (not only through a protocol-typed property).
- Run periphery scan on the Xcode project.
Actual: The implementing method is flagged as unused.
Expected: It should not be reported as unused.
(Optional: attach a minimal Xcode sample project that follows the steps above if maintainers need a repro.)
Environment
Copy the output from running:
periphery version
3.6.0
swift -version
swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
Target: arm64-apple-macosx26.0
xcodebuild -version
Xcode 26.1.1
Build version 17B100
[PeriPheryTest.zip](https://github.com/user-attachments/files/26073642/PeriPheryTest.zip)
Describe the bug
A class implements a protocol method (the method satisfies a protocol requirement). That same method is called on a concrete instance of the class in the app target. At runtime the call runs as expected, but Periphery still reports the method as unused — a false positive. It looks like the tool does not correctly connect protocol witness implementations to call sites on the concrete type (or similar indexing/analysis gap).
Reproduction
Actual: The implementing method is flagged as unused.
Expected: It should not be reported as unused.
(Optional: attach a minimal Xcode sample project that follows the steps above if maintainers need a repro.)
Environment
Copy the output from running: