Do not lower SinceKotlin version for unsigned arrays extensions if they already has some

This commit is contained in:
Ilya Gorbunov
2019-12-11 19:13:58 +03:00
parent 9566f329f0
commit 30bdd463ad
9 changed files with 13 additions and 8 deletions
@@ -16,7 +16,7 @@ object Aggregates : TemplateGroupBase() {
sequenceClassification(terminal)
}
specialFor(ArraysOfUnsigned) {
since("1.3")
sinceAtLeast("1.3")
annotation("@ExperimentalUnsignedTypes")
}
}
@@ -14,7 +14,7 @@ object ArrayOps : TemplateGroupBase() {
init {
defaultBuilder {
specialFor(ArraysOfUnsigned) {
since("1.3")
sinceAtLeast("1.3")
annotation("@ExperimentalUnsignedTypes")
}
}
@@ -14,7 +14,7 @@ object Elements : TemplateGroupBase() {
defaultBuilder {
sequenceClassification(terminal)
specialFor(ArraysOfUnsigned) {
since("1.3")
sinceAtLeast("1.3")
annotation("@ExperimentalUnsignedTypes")
}
specialFor(RangesOfPrimitives) {
@@ -19,7 +19,7 @@ object Filtering : TemplateGroupBase() {
sequenceClassification(intermediate, stateless)
specialFor(ArraysOfUnsigned) {
since("1.3")
sinceAtLeast("1.3")
annotation("@ExperimentalUnsignedTypes")
}
}
@@ -13,7 +13,7 @@ object Generators : TemplateGroupBase() {
init {
defaultBuilder {
specialFor(ArraysOfUnsigned) {
since("1.3")
sinceAtLeast("1.3")
annotation("@ExperimentalUnsignedTypes")
}
}
@@ -20,7 +20,7 @@ object Mapping : TemplateGroupBase() {
sequenceClassification(intermediate, stateless)
}
specialFor(ArraysOfUnsigned) {
since("1.3")
sinceAtLeast("1.3")
annotation("@ExperimentalUnsignedTypes")
}
}
@@ -13,7 +13,7 @@ object Numeric : TemplateGroupBase() {
defaultBuilder {
sequenceClassification(SequenceClass.terminal)
specialFor(ArraysOfUnsigned) {
since("1.3")
sinceAtLeast("1.3")
annotation("@ExperimentalUnsignedTypes")
}
}
@@ -13,7 +13,7 @@ object Ordering : TemplateGroupBase() {
init {
defaultBuilder {
specialFor(ArraysOfUnsigned) {
since("1.3")
sinceAtLeast("1.3")
annotation("@ExperimentalUnsignedTypes")
}
}
@@ -74,6 +74,11 @@ class MemberBuilder(
fun deprecate(value: Deprecation) { deprecate = value }
fun deprecate(value: String) { deprecate = Deprecation(value) }
fun since(value: String) { since = value }
fun sinceAtLeast(value: String) {
// TODO: comparing versions as strings, will work only up until Kotlin 1.10 or Kotlin 10.0
since = maxOf(since, value, nullsFirst())
}
fun platformName(name: String) { platformName = name }
fun visibility(value: String) { visibility = value }