Override "hashCode" and "equals" for Getter and Setter to fix KT-13490
This commit is contained in:
committed by
Alexander Udalov
parent
46d5e974df
commit
c959b271a4
@@ -157,6 +157,12 @@ internal abstract class KPropertyImpl<out V> private constructor(
|
||||
}
|
||||
|
||||
override fun toString(): String = "getter of $property"
|
||||
|
||||
override fun equals(other: Any?): Boolean =
|
||||
other is Getter<*> && property == other.property
|
||||
|
||||
override fun hashCode(): Int =
|
||||
property.hashCode()
|
||||
}
|
||||
|
||||
abstract class Setter<V> : Accessor<V, Unit>(), KMutableProperty.Setter<V> {
|
||||
@@ -172,6 +178,12 @@ internal abstract class KPropertyImpl<out V> private constructor(
|
||||
}
|
||||
|
||||
override fun toString(): String = "setter of $property"
|
||||
|
||||
override fun equals(other: Any?): Boolean =
|
||||
other is Setter<*> && property == other.property
|
||||
|
||||
override fun hashCode(): Int =
|
||||
property.hashCode()
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
Reference in New Issue
Block a user