Can be parameter inspection: handle usage in super call; again #KT-10819 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-05-13 14:58:06 +03:00
parent 7b1afd4e6a
commit b026969144
3 changed files with 28 additions and 2 deletions
@@ -47,4 +47,12 @@
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Constructor parameter is never used as a property</problem_class>
<description>Constructor parameter is never used as a property</description>
</problem>
<problem>
<file>test.kt</file>
<line>141</line>
<module>light_idea_test_case</module>
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
<problem_class severity="WARNING" attribute_key="NOT_USED_ELEMENT_ATTRIBUTES">Constructor parameter is never used as a property</problem_class>
<description>Constructor parameter is never used as a property</description>
</problem>
</problems>
+16 -1
View File
@@ -135,4 +135,19 @@ class UsedInLocalFunction(val x: Int) {
}
local()
}
}
}
// YES
open class Base1(s: String)
class UsedInSuper(val bar123: String) : Base1(bar123)
// NO
class UsedInLocalSuper(val bar456: String) {
fun foo() {
class Local : Base1(bar456)
}
}
// NO
class UsedInObjectSuper(val bar456: String) {
fun foo() {
object : Base1(bar456) {}
}
}