KT-53778 Remove experimental annotations from open ranges

This commit is contained in:
Ilya Gorbunov
2023-04-11 18:42:07 +02:00
committed by Space Team
parent 9953991c4c
commit b35b727d73
42 changed files with 516 additions and 540 deletions
@@ -16,14 +16,13 @@ import kotlin.internal.*
*/
@SinceKotlin("1.5")
@WasExperimental(ExperimentalUnsignedTypes::class)
@OptIn(ExperimentalStdlibApi::class)
public class UIntRange(start: UInt, endInclusive: UInt) : UIntProgression(start, endInclusive, 1), ClosedRange<UInt>, OpenEndRange<UInt> {
override val start: UInt get() = first
override val endInclusive: UInt get() = last
@SinceKotlin("1.7")
@ExperimentalStdlibApi
@Deprecated("Can throw an exception when it's impossible to represent the value with UInt type, for example, when the range includes MAX_VALUE. It's recommended to use 'endInclusive' property that doesn't throw.")
@SinceKotlin("1.9")
@WasExperimental(ExperimentalStdlibApi::class)
override val endExclusive: UInt get() {
if (last == UInt.MAX_VALUE) error("Cannot return the exclusive upper bound of a range that includes MAX_VALUE.")
return last + 1u