KT-10337 Object marked as unused

#KT-10337 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-01-15 16:48:26 +03:00
parent 4c2a14ff43
commit 4c62304a1d
7 changed files with 142 additions and 16 deletions
@@ -0,0 +1,28 @@
<problems>
<problem>
<file>usedViaMemberImport.kt</file>
<line>24</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="usedViaMemberImport.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused symbol</problem_class>
<description>Function 'f' is never used</description>
</problem>
<problem>
<file>usedViaMemberImport.kt</file>
<line>16</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="usedViaMemberImport.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused symbol</problem_class>
<description>Class 'E3' is never used</description>
</problem>
<problem>
<file>usedViaMemberImport.kt</file>
<line>20</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="usedViaMemberImport.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused symbol</problem_class>
<description>Class 'E4' is never used</description>
</problem>
</problems>
@@ -0,0 +1 @@
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
@@ -0,0 +1,27 @@
package xxx
import xxx.E1.AAA1
import xxx.E2.*
import xxx.E3.AAA3
import xxx.E4.*
enum class E1 {
AAA1, BBB1
}
enum class E2 {
AAA2, BBB2
}
enum class E3 {
AAA3, BBB3
}
enum class E4 {
AAA4, BBB4
}
fun f() {
print(AAA1)
print(AAA2)
}
@@ -3,31 +3,34 @@
<file>unused.kt</file>
<line>1</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/unused.kt" />
<entry_point TYPE="file" FQNAME="unused.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
<description>Object 'A' is never used</description>
</problem>
<problem>
<file>usedOnlyInside.kt</file>
<line>1</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/usedOnlyInside.kt" />
<entry_point TYPE="file" FQNAME="usedOnlyInside.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
<description>Object 'A' is never used</description>
</problem>
<problem>
<file>usedInTextByShortName.kt</file>
<line>3</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/usedInTextByShortName.kt" />
<entry_point TYPE="file" FQNAME="usedInTextByShortName.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
<description>Object 'UsedInTextByShortName' is never used</description>
</problem>
<problem>
<file>usedOnlyInImport.kt</file>
<line>3</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/usedOnlyInImport.kt" />
<entry_point TYPE="file" FQNAME="usedOnlyInImport.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
<description>Object 'A' is never used</description>
</problem>
@@ -36,7 +39,7 @@
<file>companionObjectUnused.kt</file>
<line>2</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/companionObjectUnused.kt" />
<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>
@@ -45,8 +48,35 @@
<file>companionObjectUnused.kt</file>
<line>7</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/companionObjectUnused.kt" />
<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>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="usedViaMemberImport.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused symbol</problem_class>
<description>Function 'bar' is never used</description>
</problem>
<problem>
<file>usedViaMemberImport.kt</file>
<line>10</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="usedViaMemberImport.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused symbol</problem_class>
<description>Object 'O2' is never used</description>
</problem>
<problem>
<file>usedViaMemberImport.kt</file>
<line>14</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="usedViaMemberImport.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused symbol</problem_class>
<description>Function 'f' is never used</description>
</problem>
</problems>
@@ -0,0 +1,16 @@
package xxx
import xxx.O1.foo
import xxx.O2.bar
object O1 {
fun foo(){}
}
object O2 {
fun bar(){}
}
fun f() {
foo()
}