Add quick fix to generate equals / hashcode in data class with arrays

So #KT-15893 Fixed
This commit is contained in:
Toshiaki Kameyama
2017-06-14 11:45:33 +03:00
committed by Mikhail Glukhikh
parent 5df5a001a1
commit b9fb7cc3a5
9 changed files with 99 additions and 6 deletions
@@ -0,0 +1,18 @@
import java.util.Arrays
data class A(val a: IntArray) {
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other?.javaClass != javaClass) return false
other as A
if (!Arrays.equals(a, other.a)) return false
return true
}
override fun hashCode(): Int {
return Arrays.hashCode(a)
}
}