woshiccm / Pecker

CodePecker is a tool to detect unused Swift code.
MIT License
1.46k stars 63 forks source link

False positive for functions from protocol #8

Closed Sherlouk closed 4 years ago

Sherlouk commented 4 years ago
protocol SomeProtocol {
  func doSomething()
}
class Implementation: SomeProtocol {
  func doSomething() { // Warning
  }
}

doSomething is called from other code via the protocol

woshiccm commented 4 years ago

屏幕快照 2019-12-10 下午9.22.28.png

woshiccm commented 4 years ago

I think maybe xcode have not indexing your code, so when check can't find the symbol of doSomething in IndexStoreDB. Maybe you reopen the project or reopen xcode, the warning will disappear. I occasionally encounter it when debugging, but rarely