Never report companion object as unused

#KT-11366 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-04-07 19:27:13 +03:00
parent f2ba83adf2
commit ecdaaea88d
3 changed files with 22 additions and 34 deletions
@@ -0,0 +1,19 @@
class Logger {
fun log(){}
}
abstract class WithLogging {
val logger = Logger()
}
class C {
companion object: WithLogging()
fun foo() {
logger.log()
}
}
fun main(args: Array<String>) {
C()
}
@@ -35,24 +35,6 @@
<description>Object 'A' is never used</description>
</problem>
<problem>
<file>companionObjectUnused.kt</file>
<line>2</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="companionObjectUnused.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
<description>Object 'Companion' is never used</description>
</problem>
<problem>
<file>companionObjectUnused.kt</file>
<line>7</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="companionObjectUnused.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
<description>Object 'Named' is never used</description>
</problem>
<problem>
<file>usedViaMemberImport.kt</file>
<line>11</line>