Stabilize unsigned types KT-45653
Deprecate specialized unsigned iterators for removal. Fix compiler tests: - drop unsignedLiteralsOn1_2 because apiVersion 1.2 is no longer supported - drop experimental unsigned literals diagnostic test
This commit is contained in:
@@ -14,8 +14,8 @@ import kotlin.internal.*
|
||||
/**
|
||||
* A range of values of type `UInt`.
|
||||
*/
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
@SinceKotlin("1.5")
|
||||
@WasExperimental(ExperimentalUnsignedTypes::class)
|
||||
public class UIntRange(start: UInt, endInclusive: UInt) : UIntProgression(start, endInclusive, 1), ClosedRange<UInt> {
|
||||
override val start: UInt get() = first
|
||||
override val endInclusive: UInt get() = last
|
||||
@@ -47,8 +47,8 @@ public class UIntRange(start: UInt, endInclusive: UInt) : UIntProgression(start,
|
||||
/**
|
||||
* A progression of values of type `UInt`.
|
||||
*/
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
@SinceKotlin("1.5")
|
||||
@WasExperimental(ExperimentalUnsignedTypes::class)
|
||||
public open class UIntProgression
|
||||
internal constructor(
|
||||
start: UInt,
|
||||
@@ -75,7 +75,7 @@ internal constructor(
|
||||
*/
|
||||
public val step: Int = step
|
||||
|
||||
override fun iterator(): UIntIterator = UIntProgressionIterator(first, last, step)
|
||||
final override fun iterator(): Iterator<UInt> = UIntProgressionIterator(first, last, step)
|
||||
|
||||
/**
|
||||
* Checks if the progression is empty.
|
||||
@@ -113,7 +113,7 @@ internal constructor(
|
||||
* @property step the number by which the value is incremented on each step.
|
||||
*/
|
||||
@SinceKotlin("1.3")
|
||||
@ExperimentalUnsignedTypes
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
private class UIntProgressionIterator(first: UInt, last: UInt, step: Int) : UIntIterator() {
|
||||
private val finalElement = last
|
||||
private var hasNext: Boolean = if (step > 0) first <= last else first >= last
|
||||
|
||||
Reference in New Issue
Block a user