diff --git a/libraries/stdlib/common/src/generated/_Ranges.kt b/libraries/stdlib/common/src/generated/_Ranges.kt index 792b7a2b191..6a981a95f41 100644 --- a/libraries/stdlib/common/src/generated/_Ranges.kt +++ b/libraries/stdlib/common/src/generated/_Ranges.kt @@ -653,7 +653,7 @@ internal fun Float.toShortExactOrNull(): Short? { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Int.until(to: Byte): IntRange { return this .. (to.toInt() - 1).toInt() @@ -662,7 +662,7 @@ public infix fun Int.until(to: Byte): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Long.until(to: Byte): LongRange { return this .. (to.toLong() - 1).toLong() @@ -671,7 +671,7 @@ public infix fun Long.until(to: Byte): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Byte.until(to: Byte): IntRange { return this.toInt() .. (to.toInt() - 1).toInt() @@ -680,7 +680,7 @@ public infix fun Byte.until(to: Byte): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Short.until(to: Byte): IntRange { return this.toInt() .. (to.toInt() - 1).toInt() @@ -689,9 +689,7 @@ public infix fun Short.until(to: Byte): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to `'\u0000'` the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Char.until(to: Char): CharRange { if (to <= '\u0000') return CharRange.EMPTY @@ -701,9 +699,7 @@ public infix fun Char.until(to: Char): CharRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to [Int.MIN_VALUE] the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Int.until(to: Int): IntRange { if (to <= Int.MIN_VALUE) return IntRange.EMPTY @@ -713,7 +709,7 @@ public infix fun Int.until(to: Int): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Long.until(to: Int): LongRange { return this .. (to.toLong() - 1).toLong() @@ -722,9 +718,7 @@ public infix fun Long.until(to: Int): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to [Int.MIN_VALUE] the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Byte.until(to: Int): IntRange { if (to <= Int.MIN_VALUE) return IntRange.EMPTY @@ -734,9 +728,7 @@ public infix fun Byte.until(to: Int): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to [Int.MIN_VALUE] the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Short.until(to: Int): IntRange { if (to <= Int.MIN_VALUE) return IntRange.EMPTY @@ -746,9 +738,7 @@ public infix fun Short.until(to: Int): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Int.until(to: Long): LongRange { if (to <= Long.MIN_VALUE) return LongRange.EMPTY @@ -758,9 +748,7 @@ public infix fun Int.until(to: Long): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Long.until(to: Long): LongRange { if (to <= Long.MIN_VALUE) return LongRange.EMPTY @@ -770,9 +758,7 @@ public infix fun Long.until(to: Long): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Byte.until(to: Long): LongRange { if (to <= Long.MIN_VALUE) return LongRange.EMPTY @@ -782,9 +768,7 @@ public infix fun Byte.until(to: Long): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to [Long.MIN_VALUE] the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Short.until(to: Long): LongRange { if (to <= Long.MIN_VALUE) return LongRange.EMPTY @@ -794,7 +778,7 @@ public infix fun Short.until(to: Long): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Int.until(to: Short): IntRange { return this .. (to.toInt() - 1).toInt() @@ -803,7 +787,7 @@ public infix fun Int.until(to: Short): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Long.until(to: Short): LongRange { return this .. (to.toLong() - 1).toLong() @@ -812,7 +796,7 @@ public infix fun Long.until(to: Short): LongRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Byte.until(to: Short): IntRange { return this.toInt() .. (to.toInt() - 1).toInt() @@ -821,7 +805,7 @@ public infix fun Byte.until(to: Short): IntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ public infix fun Short.until(to: Short): IntRange { return this.toInt() .. (to.toInt() - 1).toInt() diff --git a/libraries/stdlib/common/src/generated/_URanges.kt b/libraries/stdlib/common/src/generated/_URanges.kt index 839056a9f01..78e200b805f 100644 --- a/libraries/stdlib/common/src/generated/_URanges.kt +++ b/libraries/stdlib/common/src/generated/_URanges.kt @@ -182,7 +182,7 @@ public infix fun ULongProgression.step(step: Long): ULongProgression { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ @SinceKotlin("1.3") @ExperimentalUnsignedTypes @@ -193,9 +193,7 @@ public infix fun UByte.until(to: UByte): UIntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to [UInt.MIN_VALUE] the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ @SinceKotlin("1.3") @ExperimentalUnsignedTypes @@ -207,9 +205,7 @@ public infix fun UInt.until(to: UInt): UIntRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. - * - * If the [to] value is less than or equal to [ULong.MIN_VALUE] the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ @SinceKotlin("1.3") @ExperimentalUnsignedTypes @@ -221,7 +217,7 @@ public infix fun ULong.until(to: ULong): ULongRange { /** * Returns a range from this value up to but excluding the specified [to] value. * - * If the [to] value is less than or equal to `this` value the returned range is empty. + * If the [to] value is less than or equal to `this` value, then the returned range is empty. */ @SinceKotlin("1.3") @ExperimentalUnsignedTypes diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt index ad7a5bf1b13..006772b517a 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Ranges.kt @@ -116,17 +116,12 @@ object RangeOps : TemplateGroupBase() { val progressionType = elementType.name + "Range" returns(progressionType) val minValue = if (elementType == PrimitiveType.Char) "'\\u0000'" else "$elementType.MIN_VALUE" - val minValueRef = if (elementType == PrimitiveType.Char) "`$minValue`" else "[$minValue]" doc { """ Returns a range from this value up to but excluding the specified [to] value. - If the [to] value is less than or equal to `this` value the returned range is empty. - - ${textWhen(elementType == toType) { - "If the [to] value is less than or equal to $minValueRef the returned range is empty." - }} + If the [to] value is less than or equal to `this` value, then the returned range is empty. """ }