Generate equals and hashCode: enable for data classes #KT-17502 Fixed
This commit is contained in:
committed by
asedunov
parent
b5664755c8
commit
6971ca44e7
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user