Passing a function by reference makes Sonar think the function is unused

Template for a good new topic, formatted with Markdown:

  • GitHub
  • Bitrise
  • Bitrise Step: sonarqube-scanner@1
  • Swift
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
let something = doSomething(andThen: doThis(_:))

// Remove this unused private function
func doThis(_ result: MyResult) { 

  • Steps to reproduce
    Pass a function by reference and run the Scanner

Ticket created [SONARSWIFT-542] - Jira

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.