[K/N] Deprecate Char.MIN_RADIX and MAX_RADIX constants
As a part of efforts to stabilize Native stdlib.
This commit is contained in:
committed by
Space Team
parent
b25f3be81b
commit
da0cc2ea4d
@@ -181,11 +181,15 @@ public class Char private constructor() : Comparable<Char> {
|
||||
/**
|
||||
* The minimum radix available for conversion to and from strings.
|
||||
*/
|
||||
@Deprecated("Introduce your own constant with the value of `2`", ReplaceWith("2"))
|
||||
@DeprecatedSinceKotlin(warningSince = "1.9")
|
||||
public const val MIN_RADIX: Int = 2
|
||||
|
||||
/**
|
||||
* The maximum radix available for conversion to and from strings.
|
||||
*/
|
||||
@Deprecated("Introduce your own constant with the value of `36", ReplaceWith("36"))
|
||||
@DeprecatedSinceKotlin(warningSince = "1.9")
|
||||
public const val MAX_RADIX: Int = 36
|
||||
}
|
||||
|
||||
|
||||
@@ -222,6 +222,7 @@ public actual val Char.category: CharCategory
|
||||
* Checks whether the given [radix] is valid radix for string to number and number to string conversion.
|
||||
*/
|
||||
@PublishedApi
|
||||
@Suppress("DEPRECATION")
|
||||
internal actual fun checkRadix(radix: Int): Int {
|
||||
if(radix !in Char.MIN_RADIX..Char.MAX_RADIX) {
|
||||
throw IllegalArgumentException("radix $radix was not in valid range ${Char.MIN_RADIX..Char.MAX_RADIX}")
|
||||
|
||||
Reference in New Issue
Block a user