Unused symbol: secondary constructors are also under analysis #KT-10812 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-05-11 14:46:28 +03:00
parent b7581b35c9
commit 8920e67c5a
7 changed files with 42 additions and 4 deletions
@@ -69,4 +69,13 @@
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused Symbol</problem_class>
<description>Class 'WithNativeAnnotation' is never used</description>
</problem>
<problem>
<file>secondaryConstructor.kt</file>
<line>3</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/secondaryConstructor.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Unused symbol</problem_class>
<description>Constructor is never used</description>
</problem>
</problems>
@@ -0,0 +1,10 @@
class Owner(val name: String, val code: Int) {
constructor(name: String): this(name, 0)
constructor(code: Int): this("", code)
}
@test.anno.EntryPoint
fun use(): Int {
val owner = Owner("xyz")
return if (owner.name != "") owner.code else -1
}