Compile unsigned types sourceset with 1.3 and annotate them with SinceKotlin("1.3")

This commit is contained in:
Ilya Gorbunov
2018-06-29 16:08:50 +03:00
parent a72ad8b267
commit 615f57f2fc
15 changed files with 59 additions and 2 deletions
@@ -14,6 +14,7 @@ import kotlin.internal.*
/**
* A range of values of type `UInt`.
*/
@SinceKotlin("1.3")
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
@@ -40,6 +41,7 @@ public class UIntRange(start: UInt, endInclusive: UInt) : UIntProgression(start,
/**
* A progression of values of type `UInt`.
*/
@SinceKotlin("1.3")
public open class UIntProgression
internal constructor(
start: UInt,
@@ -95,6 +97,7 @@ internal constructor(
* An iterator over a progression of values of type `UInt`.
* @property step the number by which the value is incremented on each step.
*/
@SinceKotlin("1.3")
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