Array in data class inspection: warning on array properties in data classes #KT-10299 Fixed
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
<problems>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>1</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Array property in data class</problem_class>
|
||||
<description>Array property in data class: it's recommended to override equals() / hashCode()</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>test.kt</file>
|
||||
<line>5</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/test.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Array property in data class</problem_class>
|
||||
<description>Array property in data class: it's recommended to override equals() / hashCode()</description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1 @@
|
||||
// INSPECTION_CLASS: org.jetbrains.kotlin.idea.inspections.ArrayInDataClassInspection
|
||||
@@ -0,0 +1,11 @@
|
||||
data class First(val x: Array<String>, val y: Int)
|
||||
|
||||
class Second(val x: Array<String>)
|
||||
|
||||
data class Third(val x: String, val y: IntArray)
|
||||
|
||||
data class Correct(val x: IntArray) {
|
||||
override fun equals(other: Any?) = other is Correct
|
||||
|
||||
override fun hashCode() = 0
|
||||
}
|
||||
Reference in New Issue
Block a user