Uploaded image for project: 'Analyzer for Kotlin'
  1. Analyzer for Kotlin
  2. SONARKT-139

S1128: FP despite reference to constant in companion object of target class

    XMLWordPrintable

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: None
    • Labels:
      None

      Description

      We are currently seeing some erroneous issues being raised on imports that are, in fact, being used. Take MyClass that defines a companion object containing a field A_VAL. Reference that with MyClass.A_VAL from another class, requiring the import somepackage.MyClass. This import will be flagged as unused, which is incorrect.

      This issue was raised by the community in this thread and this thread

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              margarita.nedzelska Margarita Nedzelska
              Reporter:
              johann.beleites Johann Beleites
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: