KT-7021 Don't mark companion object as unused if some stuff from it is used
#KT-7021 fixed
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user