From 845d755fddfce505033fc9fe20677d5bdbe40e4e Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 9 Apr 2015 15:49:38 +0300 Subject: [PATCH] Make Char-related constants to be properties in Char companion object. --- libraries/stdlib/src/kotlin/text/Char.kt | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/libraries/stdlib/src/kotlin/text/Char.kt b/libraries/stdlib/src/kotlin/text/Char.kt index 0150ef96083..bd80181e112 100644 --- a/libraries/stdlib/src/kotlin/text/Char.kt +++ b/libraries/stdlib/src/kotlin/text/Char.kt @@ -43,34 +43,33 @@ public fun Char.equals(other: Char, ignoreCase: Boolean = false): Boolean { /** * Returns `true` if this character is a Unicode high-surrogate code unit (also known as leading-surrogate code unit). */ -public fun Char.isHighSurrogate(): Boolean = this in MIN_HIGH_SURROGATE..MAX_HIGH_SURROGATE +public fun Char.isHighSurrogate(): Boolean = this in Char.MIN_HIGH_SURROGATE..Char.MAX_HIGH_SURROGATE /** * Returns `true` if this character is a Unicode low-surrogate code unit (also known as trailing-surrogate code unit). */ -public fun Char.isLowSurrogate(): Boolean = this in MIN_LOW_SURROGATE..MAX_LOW_SURROGATE +public fun Char.isLowSurrogate(): Boolean = this in Char.MIN_LOW_SURROGATE..Char.MAX_LOW_SURROGATE -// TODO: make these constants public in Char.Companion after resolving #KT-7271 /** * The minimum value of a Unicode high-surrogate code unit */ -private val MIN_HIGH_SURROGATE: Char +public val Char.Companion.MIN_HIGH_SURROGATE: Char get() = '\uD800' /** * The maximum value of a Unicode high-surrogate code unit */ -private val MAX_HIGH_SURROGATE: Char +public val Char.Companion.MAX_HIGH_SURROGATE: Char get() = '\uDBFF' /** * The minimum value of a Unicode low-surrogate code unit */ -private val MIN_LOW_SURROGATE: Char +public val Char.Companion.MIN_LOW_SURROGATE: Char get() = '\uDC00' /** * The maximum value of a Unicode low-surrogate code unit */ -private val MAX_LOW_SURROGATE: Char +public val Char.Companion.MAX_LOW_SURROGATE: Char get() = '\uDFFF' \ No newline at end of file