diff --git a/libraries/stdlib/js-ir/builtins/Char.kt b/libraries/stdlib/js-ir/builtins/Char.kt index 7defee2f666..850918dd42f 100644 --- a/libraries/stdlib/js-ir/builtins/Char.kt +++ b/libraries/stdlib/js-ir/builtins/Char.kt @@ -12,7 +12,7 @@ package kotlin // TODO: KT-35100 //@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS") //public inline class Char internal constructor (val value: Int) : Comparable { -public data class Char internal constructor(val value: Int) : Comparable { +public class Char internal constructor(val value: Int) : Comparable { /** * Compares this value with the specified value for order. @@ -52,6 +52,15 @@ public data class Char internal constructor(val value: Int) : Comparable { /** Returns the value of this character as a `Double`. */ public fun toDouble(): Double = value.toDouble() + override fun equals(other: Any?): Boolean { + if (other === this) return true + if (other !is Char) return false + + return this.value == other.value + } + + override fun hashCode(): Int = value + // TODO implicit usages of toString and valueOf must be covered in DCE @Suppress("JS_NAME_PROHIBITED_FOR_OVERRIDE") @JsName("toString")