diff --git a/generators/builtins/unsignedTypes.kt b/generators/builtins/unsignedTypes.kt index 8b7572b22f4..0a8134006eb 100644 --- a/generators/builtins/unsignedTypes.kt +++ b/generators/builtins/unsignedTypes.kt @@ -229,17 +229,6 @@ class UnsignedTypeGenerator(val type: UnsignedType, out: PrintWriter) : BuiltIns UnsignedType.ULONG -> out.println("ulongToString(data)") else -> error(type) } - out.println() - - out.print(" public override fun hashCode(): Int = ") - when (type) { - UnsignedType.UBYTE, UnsignedType.USHORT, UnsignedType.UINT -> out.println("toInt()") - UnsignedType.ULONG -> out.println("((this shr 32).toInt() xor this.toInt())") - } - out.println() - - out.println(" public override fun equals(other: Any?): Boolean =") - out.println(" other is ${type.capitalized} && this.data == other.data") out.println() } diff --git a/libraries/stdlib/unsigned/src/kotlin/UByte.kt b/libraries/stdlib/unsigned/src/kotlin/UByte.kt index 962da20ba85..4ed06b39565 100644 --- a/libraries/stdlib/unsigned/src/kotlin/UByte.kt +++ b/libraries/stdlib/unsigned/src/kotlin/UByte.kt @@ -138,11 +138,6 @@ public inline class UByte internal constructor(private val data: Byte) : Compara public override fun toString(): String = toInt().toString() - public override fun hashCode(): Int = toInt() - - public override fun equals(other: Any?): Boolean = - other is UByte && this.data == other.data - } @SinceKotlin("1.3") diff --git a/libraries/stdlib/unsigned/src/kotlin/UInt.kt b/libraries/stdlib/unsigned/src/kotlin/UInt.kt index e42a22bb114..bf6560144cc 100644 --- a/libraries/stdlib/unsigned/src/kotlin/UInt.kt +++ b/libraries/stdlib/unsigned/src/kotlin/UInt.kt @@ -142,11 +142,6 @@ public inline class UInt internal constructor(private val data: Int) : Comparabl public override fun toString(): String = toLong().toString() - public override fun hashCode(): Int = toInt() - - public override fun equals(other: Any?): Boolean = - other is UInt && this.data == other.data - } @SinceKotlin("1.3") diff --git a/libraries/stdlib/unsigned/src/kotlin/ULong.kt b/libraries/stdlib/unsigned/src/kotlin/ULong.kt index 8b6efb7c27d..3cf24982049 100644 --- a/libraries/stdlib/unsigned/src/kotlin/ULong.kt +++ b/libraries/stdlib/unsigned/src/kotlin/ULong.kt @@ -142,11 +142,6 @@ public inline class ULong internal constructor(private val data: Long) : Compara public override fun toString(): String = ulongToString(data) - public override fun hashCode(): Int = ((this shr 32).toInt() xor this.toInt()) - - public override fun equals(other: Any?): Boolean = - other is ULong && this.data == other.data - } @SinceKotlin("1.3") diff --git a/libraries/stdlib/unsigned/src/kotlin/UShort.kt b/libraries/stdlib/unsigned/src/kotlin/UShort.kt index fc1f5488183..57b64e0a202 100644 --- a/libraries/stdlib/unsigned/src/kotlin/UShort.kt +++ b/libraries/stdlib/unsigned/src/kotlin/UShort.kt @@ -138,11 +138,6 @@ public inline class UShort internal constructor(private val data: Short) : Compa public override fun toString(): String = toInt().toString() - public override fun hashCode(): Int = toInt() - - public override fun equals(other: Any?): Boolean = - other is UShort && this.data == other.data - } @SinceKotlin("1.3")