[stdlib-js-ir] Char shouldn't be a data class
This commit is contained in:
@@ -12,7 +12,7 @@ package kotlin
|
|||||||
// TODO: KT-35100
|
// TODO: KT-35100
|
||||||
//@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
//@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||||
//public inline class Char internal constructor (val value: Int) : Comparable<Char> {
|
//public inline class Char internal constructor (val value: Int) : Comparable<Char> {
|
||||||
public data class Char internal constructor(val value: Int) : Comparable<Char> {
|
public class Char internal constructor(val value: Int) : Comparable<Char> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compares this value with the specified value for order.
|
* Compares this value with the specified value for order.
|
||||||
@@ -52,6 +52,15 @@ public data class Char internal constructor(val value: Int) : Comparable<Char> {
|
|||||||
/** Returns the value of this character as a `Double`. */
|
/** Returns the value of this character as a `Double`. */
|
||||||
public fun toDouble(): Double = value.toDouble()
|
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
|
// TODO implicit usages of toString and valueOf must be covered in DCE
|
||||||
@Suppress("JS_NAME_PROHIBITED_FOR_OVERRIDE")
|
@Suppress("JS_NAME_PROHIBITED_FOR_OVERRIDE")
|
||||||
@JsName("toString")
|
@JsName("toString")
|
||||||
|
|||||||
Reference in New Issue
Block a user