KT-7021 Don't mark companion object as unused if some stuff from it is used

#KT-7021 fixed
This commit is contained in:
Evgeny Gerashchenko
2015-03-18 22:15:19 +03:00
parent efccde2c0b
commit edd51908ec
3 changed files with 34 additions and 16 deletions
@@ -0,0 +1,21 @@
class A {
init {
foo()
v + v
v[v] // using companion object function by convention
}
companion object {
fun foo() {
}
val v = 42
fun Int.get(a: Int) = this + a
}
}
fun main(args: Array<String>) {
A()
}
@@ -32,7 +32,6 @@
<description>Object 'A' is never used</description>
</problem>
<!--
<problem>
<file>defaultObjectUnused.kt</file>
<line>2</line>
@@ -50,5 +49,4 @@
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
<description>Object 'Named' is never used</description>
</problem>
-->
</problems>