Generate equals/hashCode(): Support content equality from stdlib
#KT-22361 Fixed
This commit is contained in:
+2
-4
@@ -1,5 +1,3 @@
|
||||
import java.util.Arrays
|
||||
|
||||
data class A(val a: IntArray) {
|
||||
<caret>override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
@@ -7,12 +5,12 @@ data class A(val a: IntArray) {
|
||||
|
||||
other as A
|
||||
|
||||
if (!Arrays.equals(a, other.a)) return false
|
||||
if (!a.contentEquals(other.a)) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return Arrays.hashCode(a)
|
||||
return a.contentHashCode()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user