From e8621cb738418557a992d5c5af0ff38d7d0648ef Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 27 Nov 2015 18:29:23 +0300 Subject: [PATCH] Drop Range interface and its extensions. --- core/builtins/src/kotlin/Range.kt | 39 +- libraries/stdlib/src/generated/_Ranges.kt | 340 ------------------ .../src/templates/Comparables.kt | 44 --- .../kotlin-stdlib-gen/src/templates/Ranges.kt | 18 +- .../src/templates/engine/Engine.kt | 2 +- 5 files changed, 5 insertions(+), 438 deletions(-) diff --git a/core/builtins/src/kotlin/Range.kt b/core/builtins/src/kotlin/Range.kt index 892155ebe4b..71409f56f0e 100644 --- a/core/builtins/src/kotlin/Range.kt +++ b/core/builtins/src/kotlin/Range.kt @@ -20,45 +20,12 @@ package kotlin.ranges * Represents a range of values (for example, numbers or characters). * See the [Kotlin language documentation](http://kotlinlang.org/docs/reference/ranges.html) for more information. */ -@Deprecated("This range has unclear inclusiveness of end value. Use ClosedRange instead.", ReplaceWith("ClosedRange")) -public interface Range> { +public interface ClosedRange> { /** * The minimum value in the range. */ public val start: T - /** - * The maximum value in the range (inclusive). - */ - public val end: T - - /** - * Checks if the specified [value] belongs to the range. - */ - public operator fun contains(value: T): Boolean - - /** - * Checks if the range is empty. - */ - public fun isEmpty(): Boolean = start > end -} - -/** - * Represents a range of values (for example, numbers or characters). - * See the [Kotlin language documentation](http://kotlinlang.org/docs/reference/ranges.html) for more information. - */ -public interface ClosedRange> : Range { - /** - * The minimum value in the range. - */ - public override val start: T - - /** - * The maximum value in the range (inclusive). - */ - @Deprecated("Use endInclusive instead.", ReplaceWith("endInclusive")) - public override val end: T get() = endInclusive - /** * The maximum value in the range (inclusive). */ @@ -67,10 +34,10 @@ public interface ClosedRange> : Range { /** * Checks whether the specified [value] belongs to the range. */ - public override operator fun contains(value: T): Boolean = value >= start && value <= endInclusive + public operator fun contains(value: T): Boolean = value >= start && value <= endInclusive /** * Checks whether the range is empty. */ - public override fun isEmpty(): Boolean = start > endInclusive + public fun isEmpty(): Boolean = start > endInclusive } diff --git a/libraries/stdlib/src/generated/_Ranges.kt b/libraries/stdlib/src/generated/_Ranges.kt index 3051f890e8f..838bdac1fd2 100644 --- a/libraries/stdlib/src/generated/_Ranges.kt +++ b/libraries/stdlib/src/generated/_Ranges.kt @@ -67,15 +67,6 @@ public fun Short.`-until`(to: Short): ShortRange { return ShortRange(this, to_) } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("intRangeContains") -public operator fun Range.contains(value: Byte): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -84,15 +75,6 @@ public operator fun ClosedRange.contains(value: Byte): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("longRangeContains") -public operator fun Range.contains(value: Byte): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -101,15 +83,6 @@ public operator fun ClosedRange.contains(value: Byte): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("shortRangeContains") -public operator fun Range.contains(value: Byte): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -118,15 +91,6 @@ public operator fun ClosedRange.contains(value: Byte): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("doubleRangeContains") -public operator fun Range.contains(value: Byte): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -135,15 +99,6 @@ public operator fun ClosedRange.contains(value: Byte): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("floatRangeContains") -public operator fun Range.contains(value: Byte): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -152,15 +107,6 @@ public operator fun ClosedRange.contains(value: Byte): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("intRangeContains") -public operator fun Range.contains(value: Double): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -169,15 +115,6 @@ public operator fun ClosedRange.contains(value: Double): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("longRangeContains") -public operator fun Range.contains(value: Double): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -186,15 +123,6 @@ public operator fun ClosedRange.contains(value: Double): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("byteRangeContains") -public operator fun Range.contains(value: Double): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -203,15 +131,6 @@ public operator fun ClosedRange.contains(value: Double): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("shortRangeContains") -public operator fun Range.contains(value: Double): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -220,15 +139,6 @@ public operator fun ClosedRange.contains(value: Double): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("floatRangeContains") -public operator fun Range.contains(value: Double): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -237,15 +147,6 @@ public operator fun ClosedRange.contains(value: Double): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("intRangeContains") -public operator fun Range.contains(value: Float): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -254,15 +155,6 @@ public operator fun ClosedRange.contains(value: Float): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("longRangeContains") -public operator fun Range.contains(value: Float): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -271,15 +163,6 @@ public operator fun ClosedRange.contains(value: Float): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("byteRangeContains") -public operator fun Range.contains(value: Float): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -288,15 +171,6 @@ public operator fun ClosedRange.contains(value: Float): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("shortRangeContains") -public operator fun Range.contains(value: Float): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -305,15 +179,6 @@ public operator fun ClosedRange.contains(value: Float): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("doubleRangeContains") -public operator fun Range.contains(value: Float): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -322,15 +187,6 @@ public operator fun ClosedRange.contains(value: Float): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("longRangeContains") -public operator fun Range.contains(value: Int): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -339,15 +195,6 @@ public operator fun ClosedRange.contains(value: Int): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("byteRangeContains") -public operator fun Range.contains(value: Int): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -356,15 +203,6 @@ public operator fun ClosedRange.contains(value: Int): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("shortRangeContains") -public operator fun Range.contains(value: Int): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -373,15 +211,6 @@ public operator fun ClosedRange.contains(value: Int): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("doubleRangeContains") -public operator fun Range.contains(value: Int): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -390,15 +219,6 @@ public operator fun ClosedRange.contains(value: Int): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("floatRangeContains") -public operator fun Range.contains(value: Int): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -407,15 +227,6 @@ public operator fun ClosedRange.contains(value: Int): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("intRangeContains") -public operator fun Range.contains(value: Long): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -424,15 +235,6 @@ public operator fun ClosedRange.contains(value: Long): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("byteRangeContains") -public operator fun Range.contains(value: Long): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -441,15 +243,6 @@ public operator fun ClosedRange.contains(value: Long): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("shortRangeContains") -public operator fun Range.contains(value: Long): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -458,15 +251,6 @@ public operator fun ClosedRange.contains(value: Long): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("doubleRangeContains") -public operator fun Range.contains(value: Long): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -475,15 +259,6 @@ public operator fun ClosedRange.contains(value: Long): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("floatRangeContains") -public operator fun Range.contains(value: Long): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -492,15 +267,6 @@ public operator fun ClosedRange.contains(value: Long): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("intRangeContains") -public operator fun Range.contains(value: Short): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -509,15 +275,6 @@ public operator fun ClosedRange.contains(value: Short): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("longRangeContains") -public operator fun Range.contains(value: Short): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -526,15 +283,6 @@ public operator fun ClosedRange.contains(value: Short): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("byteRangeContains") -public operator fun Range.contains(value: Short): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -543,15 +291,6 @@ public operator fun ClosedRange.contains(value: Short): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("doubleRangeContains") -public operator fun Range.contains(value: Short): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -560,15 +299,6 @@ public operator fun ClosedRange.contains(value: Short): Boolean { return start <= value && value <= endInclusive } -/** - * Checks if the specified [value] belongs to this range. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -@kotlin.jvm.JvmName("floatRangeContains") -public operator fun Range.contains(value: Short): Boolean { - return start <= value && value <= end -} - /** * Checks if the specified [value] belongs to this range. */ @@ -1286,73 +1016,3 @@ public fun Long.coerceIn(range: ClosedRange): Long { return if (this < range.start) range.start else if (this > range.endInclusive) range.endInclusive else this } -/** - * Ensures that this value lies in the specified [range]. - * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. - */ -@Deprecated("Provided for binary compatibility", level = DeprecationLevel.HIDDEN) -public fun > T.coerceIn(range: Range): T { - if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: $range.") - return if (this < range.start) range.start else if (this > range.end) range.end else this -} - -/** - * Ensures that this value lies in the specified [range]. - * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -public fun Byte.coerceIn(range: Range): Byte { - if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: $range.") - return if (this < range.start) range.start else if (this > range.end) range.end else this -} - -/** - * Ensures that this value lies in the specified [range]. - * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -public fun Int.coerceIn(range: Range): Int { - if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: $range.") - return if (this < range.start) range.start else if (this > range.end) range.end else this -} - -/** - * Ensures that this value lies in the specified [range]. - * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -public fun Long.coerceIn(range: Range): Long { - if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: $range.") - return if (this < range.start) range.start else if (this > range.end) range.end else this -} - -/** - * Ensures that this value lies in the specified [range]. - * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. - */ -@Deprecated("Range is deprecated. Use ClosedRange instead.") -public fun Short.coerceIn(range: Range): Short { - if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: $range.") - return if (this < range.start) range.start else if (this > range.end) range.end else this -} - -/** - * Ensures that this value lies in the specified [range]. - * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. - */ -@Deprecated("Provided for binary compatibility", level = DeprecationLevel.HIDDEN) -public fun Double.coerceIn(range: Range): Double { - if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: $range.") - return if (this < range.start) range.start else if (this > range.end) range.end else this -} - -/** - * Ensures that this value lies in the specified [range]. - * @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. - */ -@Deprecated("Provided for binary compatibility", level = DeprecationLevel.HIDDEN) -public fun Float.coerceIn(range: Range): Float { - if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: $range.") - return if (this < range.start) range.start else if (this > range.end) range.end else this -} - diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Comparables.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Comparables.kt index 86f8bad8d61..f3ae590ca5a 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Comparables.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Comparables.kt @@ -46,50 +46,6 @@ fun comparables(): List { } } - templates add f("coerceIn(range: Range)") { - sourceFile(SourceFile.Ranges) - only(Generic, Primitives) - only(numericPrimitives.filter { it.isIntegral() }) - typeParam("T: Comparable") - returns("SELF") - deprecate("Range is deprecated. Use ClosedRange instead.") - deprecate(Generic) { forBinaryCompatibility } - doc { - """ - Ensures that this value lies in the specified [range]. - - @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. - """ - } - body { - """ - if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: ${'$'}range.") - return if (this < range.start) range.start else if (this > range.end) range.end else this - """ - } - } - - templates add f("coerceIn(range: Range)") { - sourceFile(SourceFile.Ranges) - only(Primitives) - only(numericPrimitives.filterNot { it.isIntegral() }) - returns("SELF") - deprecate { forBinaryCompatibility } // force use generic overload instead - doc { - """ - Ensures that this value lies in the specified [range]. - - @return this value if it's in the [range], or range.start if this value is less than range.start, or range.end if this value is greater than range.end. - """ - } - body { - """ - if (range.isEmpty()) throw IllegalArgumentException("Cannot coerce value to an empty range: ${'$'}range.") - return if (this < range.start) range.start else if (this > range.end) range.end else this - """ - } - } - templates add f("coerceIn(range: ClosedRange)") { sourceFile(SourceFile.Ranges) only(Primitives, Generic) diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt index bf43c3247a2..b8b9aab277e 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt @@ -238,27 +238,12 @@ fun ranges(): List { templates addAll integralPermutations.map { until(it.first, it.second) } templates addAll listOf(PrimitiveType.Byte, PrimitiveType.Short).permutations().map { untilDeprecated(it.first, it.second) } - fun containsDeprecated(rangeType: PrimitiveType, itemType: PrimitiveType) = f("contains(value: $itemType)") { - operator(true) - - deprecate("Range is deprecated. Use ClosedRange instead.") - - check(rangeType.isNumeric() == itemType.isNumeric()) { "Required rangeType and itemType both to be numeric or both not, got: $rangeType, $itemType" } - only(Ranges) - onlyPrimitives(Ranges, rangeType) - platformName("${rangeType.name.decapitalize()}RangeContains") - returns("Boolean") - doc { "Checks if the specified [value] belongs to this range." } - body { "return start <= value && value <= end" } - } - fun contains(rangeType: PrimitiveType, itemType: PrimitiveType) = f("contains(value: $itemType)") { operator(true) check(rangeType.isNumeric() == itemType.isNumeric()) { "Required rangeType and itemType both to be numeric or both not, got: $rangeType, $itemType" } only(Ranges) onlyPrimitives(Ranges, rangeType) - customReceiver("ClosedRange") platformName("${rangeType.name.decapitalize()}RangeContains") returns("Boolean") doc { "Checks if the specified [value] belongs to this range." } @@ -266,8 +251,7 @@ fun ranges(): List { } - templates addAll numericPermutations.filter { it.first != it.second } - .flatMap { listOf(containsDeprecated(it.first, it.second), contains(it.first, it.second)) } + templates addAll numericPermutations.filter { it.first != it.second }.map { contains(it.first, it.second) } return templates diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/engine/Engine.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/engine/Engine.kt index 20d27a31e22..a665e000720 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/engine/Engine.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/engine/Engine.kt @@ -305,7 +305,7 @@ class GenericFunction(val signature: String, val keyword: String = "fun") { ArraysOfObjects -> "Array<${isAsteriskOrT.replace("T", "out T")}>" Strings -> "String" CharSequences -> "CharSequence" - Ranges -> "Range<$isAsteriskOrT>" + Ranges -> "ClosedRange<$isAsteriskOrT>" ArraysOfPrimitives -> primitive?.let { it.name + "Array" } ?: throw IllegalArgumentException("Primitive array should specify primitive type") RangesOfPrimitives -> primitive?.let { it.name + "Range" } ?: throw IllegalArgumentException("Primitive range should specify primitive type") ProgressionsOfPrimitives -> primitive?.let { it.name + "Progression" } ?: throw IllegalArgumentException("Primitive progression should specify primitive type")