Generate equals and hashCode: enable for data classes #KT-17502 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-10-30 16:16:23 +09:00
committed by asedunov
parent b5664755c8
commit 6971ca44e7
3 changed files with 35 additions and 32 deletions
@@ -1,2 +1 @@
// NOT_APPLICABLE
data class A<caret>(val n: Int)
@@ -0,0 +1,16 @@
data class A(val n: Int) {
<caret>override fun equals(other: Any?): Boolean {
if (this === other) return true
if (javaClass != other?.javaClass) return false
other as A
if (n != other.n) return false
return true
}
override fun hashCode(): Int {
return n
}
}