Generate equals()/hashCode(): Fix hashCode() implementation

#KT-11638 Fixed
This commit is contained in:
Alexey Sedunov
2016-03-28 18:21:57 +03:00
parent 768da05ba9
commit cbb6f7ed63
10 changed files with 16 additions and 15 deletions
@@ -22,8 +22,8 @@ class A(val n: IntArray?, val s: Array<String>?) {
override fun hashCode(): Int{
var result = n?.let { Arrays.hashCode(it) } ?: 0
result += 31 * result + (s?.let { Arrays.hashCode(it) } ?: 0)
result += 31 * result + f.hashCode()
result = 31 * result + (s?.let { Arrays.hashCode(it) } ?: 0)
result = 31 * result + f.hashCode()
return result
}
}