From 60fbb0d1712a0f08bd1b4851967dd597ba9ca489 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 10 Mar 2022 20:09:24 +0300 Subject: [PATCH] Reintroduce min/max operations for non-empty collections KT-50146 --- .../stdlib/api/js-v1/kotlin.collections.kt | 598 ++++---- .../stdlib/api/js-v1/kotlin.sequences.kt | 64 +- libraries/stdlib/api/js-v1/kotlin.text.kt | 36 +- libraries/stdlib/api/js/kotlin.collections.kt | 598 ++++---- libraries/stdlib/api/js/kotlin.sequences.kt | 64 +- libraries/stdlib/api/js/kotlin.text.kt | 36 +- .../stdlib/common/src/generated/_Arrays.kt | 1302 ++++++++++++++--- .../common/src/generated/_Collections.kt | 238 ++- .../stdlib/common/src/generated/_Maps.kt | 62 +- .../stdlib/common/src/generated/_Sequences.kt | 282 +++- .../stdlib/common/src/generated/_Strings.kt | 138 +- .../stdlib/common/src/generated/_UArrays.kt | 576 ++++++-- .../stdlib/jvm/src/generated/_ArraysJvm.kt | 396 +++++ .../jvm/src/generated/_CollectionsJvm.kt | 74 + .../stdlib/jvm/src/generated/_MapsJvm.kt | 48 + .../stdlib/jvm/src/generated/_SequencesJvm.kt | 74 + .../stdlib/jvm/src/generated/_StringsJvm.kt | 42 + .../stdlib/jvm/src/generated/_UArraysJvm.kt | 224 +++ .../kotlin-stdlib-runtime-merged.txt | 98 ++ .../src/templates/Aggregates.kt | 96 +- 20 files changed, 3796 insertions(+), 1250 deletions(-) create mode 100644 libraries/stdlib/jvm/src/generated/_MapsJvm.kt diff --git a/libraries/stdlib/api/js-v1/kotlin.collections.kt b/libraries/stdlib/api/js-v1/kotlin.collections.kt index c1b0115c42b..38907e90de4 100644 --- a/libraries/stdlib/api/js-v1/kotlin.collections.kt +++ b/libraries/stdlib/api/js-v1/kotlin.collections.kt @@ -4183,158 +4183,146 @@ public inline fun kotlin.collections.Map.mapValues(transform public inline fun > kotlin.collections.Map.mapValuesTo(destination: M, transform: (kotlin.collections.Map.Entry) -> R): M -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.Array.max(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun > kotlin.Array.max(): T -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.Array.max(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.Array.max(): kotlin.Double -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.Array.max(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.Array.max(): kotlin.Float -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ByteArray.max(): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.ByteArray.max(): kotlin.Byte -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharArray.max(): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.CharArray.max(): kotlin.Char -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.DoubleArray.max(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.DoubleArray.max(): kotlin.Double -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.FloatArray.max(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.FloatArray.max(): kotlin.Float -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.IntArray.max(): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.IntArray.max(): kotlin.Int -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.LongArray.max(): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.LongArray.max(): kotlin.Long -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ShortArray.max(): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.ShortArray.max(): kotlin.Short -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UByteArray.max(): kotlin.UByte? +public fun kotlin.UByteArray.max(): kotlin.UByte -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UIntArray.max(): kotlin.UInt? +public fun kotlin.UIntArray.max(): kotlin.UInt -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.ULongArray.max(): kotlin.ULong? +public fun kotlin.ULongArray.max(): kotlin.ULong -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UShortArray.max(): kotlin.UShort? +public fun kotlin.UShortArray.max(): kotlin.UShort -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.collections.Iterable.max(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun > kotlin.collections.Iterable.max(): T -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.collections.Iterable.max(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.collections.Iterable.max(): kotlin.Double -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.collections.Iterable.max(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.collections.Iterable.max(): kotlin.Float -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.Array.maxBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.Array.maxBy(selector: (T) -> R): T -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.BooleanArray.maxBy(selector: (kotlin.Boolean) -> R): kotlin.Boolean? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.BooleanArray.maxBy(selector: (kotlin.Boolean) -> R): kotlin.Boolean -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.ByteArray.maxBy(selector: (kotlin.Byte) -> R): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.ByteArray.maxBy(selector: (kotlin.Byte) -> R): kotlin.Byte -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.CharArray.maxBy(selector: (kotlin.Char) -> R): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.CharArray.maxBy(selector: (kotlin.Char) -> R): kotlin.Char -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.DoubleArray.maxBy(selector: (kotlin.Double) -> R): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.DoubleArray.maxBy(selector: (kotlin.Double) -> R): kotlin.Double -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.FloatArray.maxBy(selector: (kotlin.Float) -> R): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.FloatArray.maxBy(selector: (kotlin.Float) -> R): kotlin.Float -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.IntArray.maxBy(selector: (kotlin.Int) -> R): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.IntArray.maxBy(selector: (kotlin.Int) -> R): kotlin.Int -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.LongArray.maxBy(selector: (kotlin.Long) -> R): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.LongArray.maxBy(selector: (kotlin.Long) -> R): kotlin.Long -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.ShortArray.maxBy(selector: (kotlin.Short) -> R): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.ShortArray.maxBy(selector: (kotlin.Short) -> R): kotlin.Short -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UByteArray.maxBy(selector: (kotlin.UByte) -> R): kotlin.UByte? +public inline fun > kotlin.UByteArray.maxBy(selector: (kotlin.UByte) -> R): kotlin.UByte -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UIntArray.maxBy(selector: (kotlin.UInt) -> R): kotlin.UInt? +public inline fun > kotlin.UIntArray.maxBy(selector: (kotlin.UInt) -> R): kotlin.UInt -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.ULongArray.maxBy(selector: (kotlin.ULong) -> R): kotlin.ULong? +public inline fun > kotlin.ULongArray.maxBy(selector: (kotlin.ULong) -> R): kotlin.ULong -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UShortArray.maxBy(selector: (kotlin.UShort) -> R): kotlin.UShort? +public inline fun > kotlin.UShortArray.maxBy(selector: (kotlin.UShort) -> R): kotlin.UShort -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.collections.Iterable.maxBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.collections.Iterable.maxBy(selector: (T) -> R): T -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") @kotlin.internal.InlineOnly -public inline fun > kotlin.collections.Map.maxBy(selector: (kotlin.collections.Map.Entry) -> R): kotlin.collections.Map.Entry? +public inline fun > kotlin.collections.Map.maxBy(selector: (kotlin.collections.Map.Entry) -> R): kotlin.collections.Map.Entry @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.Array.maxByOrNull(selector: (T) -> R): T? @@ -5077,74 +5065,70 @@ public fun kotlin.collections.Iterable.maxOrNull(): kotlin.Double @kotlin.SinceKotlin(version = "1.4") public fun kotlin.collections.Iterable.maxOrNull(): kotlin.Float? -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.Array.maxWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.Array.maxWith(comparator: kotlin.Comparator): T -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.BooleanArray.maxWith(comparator: kotlin.Comparator): kotlin.Boolean? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.BooleanArray.maxWith(comparator: kotlin.Comparator): kotlin.Boolean -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ByteArray.maxWith(comparator: kotlin.Comparator): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.ByteArray.maxWith(comparator: kotlin.Comparator): kotlin.Byte -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharArray.maxWith(comparator: kotlin.Comparator): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.CharArray.maxWith(comparator: kotlin.Comparator): kotlin.Char -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.DoubleArray.maxWith(comparator: kotlin.Comparator): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.DoubleArray.maxWith(comparator: kotlin.Comparator): kotlin.Double -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.FloatArray.maxWith(comparator: kotlin.Comparator): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.FloatArray.maxWith(comparator: kotlin.Comparator): kotlin.Float -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.IntArray.maxWith(comparator: kotlin.Comparator): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.IntArray.maxWith(comparator: kotlin.Comparator): kotlin.Int -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.LongArray.maxWith(comparator: kotlin.Comparator): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.LongArray.maxWith(comparator: kotlin.Comparator): kotlin.Long -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ShortArray.maxWith(comparator: kotlin.Comparator): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.ShortArray.maxWith(comparator: kotlin.Comparator): kotlin.Short -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UByteArray.maxWith(comparator: kotlin.Comparator): kotlin.UByte? +public fun kotlin.UByteArray.maxWith(comparator: kotlin.Comparator): kotlin.UByte -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UIntArray.maxWith(comparator: kotlin.Comparator): kotlin.UInt? +public fun kotlin.UIntArray.maxWith(comparator: kotlin.Comparator): kotlin.UInt -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.ULongArray.maxWith(comparator: kotlin.Comparator): kotlin.ULong? +public fun kotlin.ULongArray.maxWith(comparator: kotlin.Comparator): kotlin.ULong -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UShortArray.maxWith(comparator: kotlin.Comparator): kotlin.UShort? +public fun kotlin.UShortArray.maxWith(comparator: kotlin.Comparator): kotlin.UShort -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.collections.Iterable.maxWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.collections.Iterable.maxWith(comparator: kotlin.Comparator): T -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") @kotlin.internal.InlineOnly -public inline fun kotlin.collections.Map.maxWith(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry? +public inline fun kotlin.collections.Map.maxWith(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry @kotlin.SinceKotlin(version = "1.4") public fun kotlin.Array.maxWithOrNull(comparator: kotlin.Comparator): T? @@ -5196,157 +5180,146 @@ public fun kotlin.collections.Iterable.maxWithOrNull(comparator: kotlin.C @kotlin.internal.InlineOnly public inline fun kotlin.collections.Map.maxWithOrNull(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry? -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.Array.min(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun > kotlin.Array.min(): T -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.Array.min(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.Array.min(): kotlin.Double -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.Array.min(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.Array.min(): kotlin.Float -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ByteArray.min(): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.ByteArray.min(): kotlin.Byte -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharArray.min(): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.CharArray.min(): kotlin.Char -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.DoubleArray.min(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.DoubleArray.min(): kotlin.Double -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.FloatArray.min(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.FloatArray.min(): kotlin.Float -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.IntArray.min(): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.IntArray.min(): kotlin.Int -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.LongArray.min(): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.LongArray.min(): kotlin.Long -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ShortArray.min(): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.ShortArray.min(): kotlin.Short -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UByteArray.min(): kotlin.UByte? +public fun kotlin.UByteArray.min(): kotlin.UByte -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UIntArray.min(): kotlin.UInt? +public fun kotlin.UIntArray.min(): kotlin.UInt -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.ULongArray.min(): kotlin.ULong? +public fun kotlin.ULongArray.min(): kotlin.ULong -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UShortArray.min(): kotlin.UShort? +public fun kotlin.UShortArray.min(): kotlin.UShort -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.collections.Iterable.min(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun > kotlin.collections.Iterable.min(): T -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.collections.Iterable.min(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.collections.Iterable.min(): kotlin.Double -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.collections.Iterable.min(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.collections.Iterable.min(): kotlin.Float -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.Array.minBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.Array.minBy(selector: (T) -> R): T -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.BooleanArray.minBy(selector: (kotlin.Boolean) -> R): kotlin.Boolean? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.BooleanArray.minBy(selector: (kotlin.Boolean) -> R): kotlin.Boolean -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.ByteArray.minBy(selector: (kotlin.Byte) -> R): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.ByteArray.minBy(selector: (kotlin.Byte) -> R): kotlin.Byte -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.CharArray.minBy(selector: (kotlin.Char) -> R): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.CharArray.minBy(selector: (kotlin.Char) -> R): kotlin.Char -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.DoubleArray.minBy(selector: (kotlin.Double) -> R): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.DoubleArray.minBy(selector: (kotlin.Double) -> R): kotlin.Double -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.FloatArray.minBy(selector: (kotlin.Float) -> R): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.FloatArray.minBy(selector: (kotlin.Float) -> R): kotlin.Float -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.IntArray.minBy(selector: (kotlin.Int) -> R): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.IntArray.minBy(selector: (kotlin.Int) -> R): kotlin.Int -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.LongArray.minBy(selector: (kotlin.Long) -> R): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.LongArray.minBy(selector: (kotlin.Long) -> R): kotlin.Long -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.ShortArray.minBy(selector: (kotlin.Short) -> R): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.ShortArray.minBy(selector: (kotlin.Short) -> R): kotlin.Short -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UByteArray.minBy(selector: (kotlin.UByte) -> R): kotlin.UByte? +public inline fun > kotlin.UByteArray.minBy(selector: (kotlin.UByte) -> R): kotlin.UByte -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UIntArray.minBy(selector: (kotlin.UInt) -> R): kotlin.UInt? +public inline fun > kotlin.UIntArray.minBy(selector: (kotlin.UInt) -> R): kotlin.UInt -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.ULongArray.minBy(selector: (kotlin.ULong) -> R): kotlin.ULong? +public inline fun > kotlin.ULongArray.minBy(selector: (kotlin.ULong) -> R): kotlin.ULong -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UShortArray.minBy(selector: (kotlin.UShort) -> R): kotlin.UShort? +public inline fun > kotlin.UShortArray.minBy(selector: (kotlin.UShort) -> R): kotlin.UShort -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.collections.Iterable.minBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.collections.Iterable.minBy(selector: (T) -> R): T -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.collections.Map.minBy(selector: (kotlin.collections.Map.Entry) -> R): kotlin.collections.Map.Entry? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +@kotlin.internal.InlineOnly +public inline fun > kotlin.collections.Map.minBy(selector: (kotlin.collections.Map.Entry) -> R): kotlin.collections.Map.Entry @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.Array.minByOrNull(selector: (T) -> R): T? @@ -6089,73 +6062,70 @@ public fun kotlin.collections.Iterable.minOrNull(): kotlin.Double @kotlin.SinceKotlin(version = "1.4") public fun kotlin.collections.Iterable.minOrNull(): kotlin.Float? -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.Array.minWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.Array.minWith(comparator: kotlin.Comparator): T -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.BooleanArray.minWith(comparator: kotlin.Comparator): kotlin.Boolean? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.BooleanArray.minWith(comparator: kotlin.Comparator): kotlin.Boolean -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ByteArray.minWith(comparator: kotlin.Comparator): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.ByteArray.minWith(comparator: kotlin.Comparator): kotlin.Byte -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharArray.minWith(comparator: kotlin.Comparator): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.CharArray.minWith(comparator: kotlin.Comparator): kotlin.Char -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.DoubleArray.minWith(comparator: kotlin.Comparator): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.DoubleArray.minWith(comparator: kotlin.Comparator): kotlin.Double -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.FloatArray.minWith(comparator: kotlin.Comparator): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.FloatArray.minWith(comparator: kotlin.Comparator): kotlin.Float -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.IntArray.minWith(comparator: kotlin.Comparator): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.IntArray.minWith(comparator: kotlin.Comparator): kotlin.Int -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.LongArray.minWith(comparator: kotlin.Comparator): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.LongArray.minWith(comparator: kotlin.Comparator): kotlin.Long -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ShortArray.minWith(comparator: kotlin.Comparator): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.ShortArray.minWith(comparator: kotlin.Comparator): kotlin.Short -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UByteArray.minWith(comparator: kotlin.Comparator): kotlin.UByte? +public fun kotlin.UByteArray.minWith(comparator: kotlin.Comparator): kotlin.UByte -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UIntArray.minWith(comparator: kotlin.Comparator): kotlin.UInt? +public fun kotlin.UIntArray.minWith(comparator: kotlin.Comparator): kotlin.UInt -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.ULongArray.minWith(comparator: kotlin.Comparator): kotlin.ULong? +public fun kotlin.ULongArray.minWith(comparator: kotlin.Comparator): kotlin.ULong -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UShortArray.minWith(comparator: kotlin.Comparator): kotlin.UShort? +public fun kotlin.UShortArray.minWith(comparator: kotlin.Comparator): kotlin.UShort -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.collections.Iterable.minWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.collections.Iterable.minWith(comparator: kotlin.Comparator): T -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.collections.Map.minWith(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +@kotlin.internal.InlineOnly +public inline fun kotlin.collections.Map.minWith(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry @kotlin.SinceKotlin(version = "1.4") public fun kotlin.Array.minWithOrNull(comparator: kotlin.Comparator): T? diff --git a/libraries/stdlib/api/js-v1/kotlin.sequences.kt b/libraries/stdlib/api/js-v1/kotlin.sequences.kt index b61231639d6..6a844af4d5a 100644 --- a/libraries/stdlib/api/js-v1/kotlin.sequences.kt +++ b/libraries/stdlib/api/js-v1/kotlin.sequences.kt @@ -253,23 +253,21 @@ public inline fun > kotlin.sequences.Sequence.mapTo(destination: C, transform: (T) -> R): C -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.sequences.Sequence.max(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun > kotlin.sequences.Sequence.max(): T -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.sequences.Sequence.max(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.sequences.Sequence.max(): kotlin.Double -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.sequences.Sequence.max(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.sequences.Sequence.max(): kotlin.Float -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.sequences.Sequence.maxBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.sequences.Sequence.maxBy(selector: (T) -> R): T @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.sequences.Sequence.maxByOrNull(selector: (T) -> R): T? @@ -323,30 +321,28 @@ public fun kotlin.sequences.Sequence.maxOrNull(): kotlin.Double? @kotlin.SinceKotlin(version = "1.4") public fun kotlin.sequences.Sequence.maxOrNull(): kotlin.Float? -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.sequences.Sequence.maxWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.sequences.Sequence.maxWith(comparator: kotlin.Comparator): T @kotlin.SinceKotlin(version = "1.4") public fun kotlin.sequences.Sequence.maxWithOrNull(comparator: kotlin.Comparator): T? -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.sequences.Sequence.min(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun > kotlin.sequences.Sequence.min(): T -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.sequences.Sequence.min(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.sequences.Sequence.min(): kotlin.Double -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.sequences.Sequence.min(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.sequences.Sequence.min(): kotlin.Float -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.sequences.Sequence.minBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.sequences.Sequence.minBy(selector: (T) -> R): T @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.sequences.Sequence.minByOrNull(selector: (T) -> R): T? @@ -400,9 +396,9 @@ public fun kotlin.sequences.Sequence.minOrNull(): kotlin.Double? @kotlin.SinceKotlin(version = "1.4") public fun kotlin.sequences.Sequence.minOrNull(): kotlin.Float? -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.sequences.Sequence.minWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.sequences.Sequence.minWith(comparator: kotlin.Comparator): T @kotlin.SinceKotlin(version = "1.4") public fun kotlin.sequences.Sequence.minWithOrNull(comparator: kotlin.Comparator): T? diff --git a/libraries/stdlib/api/js-v1/kotlin.text.kt b/libraries/stdlib/api/js-v1/kotlin.text.kt index 16e8bd7b6a8..5a246737cdf 100644 --- a/libraries/stdlib/api/js-v1/kotlin.text.kt +++ b/libraries/stdlib/api/js-v1/kotlin.text.kt @@ -490,13 +490,13 @@ public inline infix fun kotlin.CharSequence.matches(regex: kotlin.text.Regex): k @kotlin.DeprecatedSinceKotlin(warningSince = "1.6") public fun kotlin.String.matches(regex: kotlin.String): kotlin.Boolean -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharSequence.max(): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.CharSequence.max(): kotlin.Char -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.CharSequence.maxBy(selector: (kotlin.Char) -> R): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.CharSequence.maxBy(selector: (kotlin.Char) -> R): kotlin.Char @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.CharSequence.maxByOrNull(selector: (kotlin.Char) -> R): kotlin.Char? @@ -544,20 +544,20 @@ public inline fun kotlin.CharSequence.maxOfWithOrNull(comparator: kotlin.Com @kotlin.SinceKotlin(version = "1.4") public fun kotlin.CharSequence.maxOrNull(): kotlin.Char? -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharSequence.maxWith(comparator: kotlin.Comparator): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.CharSequence.maxWith(comparator: kotlin.Comparator): kotlin.Char @kotlin.SinceKotlin(version = "1.4") public fun kotlin.CharSequence.maxWithOrNull(comparator: kotlin.Comparator): kotlin.Char? -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharSequence.min(): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.CharSequence.min(): kotlin.Char -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.CharSequence.minBy(selector: (kotlin.Char) -> R): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.CharSequence.minBy(selector: (kotlin.Char) -> R): kotlin.Char @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.CharSequence.minByOrNull(selector: (kotlin.Char) -> R): kotlin.Char? @@ -605,9 +605,9 @@ public inline fun kotlin.CharSequence.minOfWithOrNull(comparator: kotlin.Com @kotlin.SinceKotlin(version = "1.4") public fun kotlin.CharSequence.minOrNull(): kotlin.Char? -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharSequence.minWith(comparator: kotlin.Comparator): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.CharSequence.minWith(comparator: kotlin.Comparator): kotlin.Char @kotlin.SinceKotlin(version = "1.4") public fun kotlin.CharSequence.minWithOrNull(comparator: kotlin.Comparator): kotlin.Char? diff --git a/libraries/stdlib/api/js/kotlin.collections.kt b/libraries/stdlib/api/js/kotlin.collections.kt index 457e99d3e69..399107f8f1d 100644 --- a/libraries/stdlib/api/js/kotlin.collections.kt +++ b/libraries/stdlib/api/js/kotlin.collections.kt @@ -4153,158 +4153,146 @@ public inline fun kotlin.collections.Map.mapValues(transform public inline fun > kotlin.collections.Map.mapValuesTo(destination: M, transform: (kotlin.collections.Map.Entry) -> R): M -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.Array.max(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun > kotlin.Array.max(): T -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.Array.max(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.Array.max(): kotlin.Double -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.Array.max(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.Array.max(): kotlin.Float -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ByteArray.max(): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.ByteArray.max(): kotlin.Byte -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharArray.max(): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.CharArray.max(): kotlin.Char -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.DoubleArray.max(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.DoubleArray.max(): kotlin.Double -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.FloatArray.max(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.FloatArray.max(): kotlin.Float -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.IntArray.max(): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.IntArray.max(): kotlin.Int -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.LongArray.max(): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.LongArray.max(): kotlin.Long -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ShortArray.max(): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.ShortArray.max(): kotlin.Short -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UByteArray.max(): kotlin.UByte? +public fun kotlin.UByteArray.max(): kotlin.UByte -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UIntArray.max(): kotlin.UInt? +public fun kotlin.UIntArray.max(): kotlin.UInt -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.ULongArray.max(): kotlin.ULong? +public fun kotlin.ULongArray.max(): kotlin.ULong -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UShortArray.max(): kotlin.UShort? +public fun kotlin.UShortArray.max(): kotlin.UShort -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.collections.Iterable.max(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun > kotlin.collections.Iterable.max(): T -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.collections.Iterable.max(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.collections.Iterable.max(): kotlin.Double -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.collections.Iterable.max(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.collections.Iterable.max(): kotlin.Float -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.Array.maxBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.Array.maxBy(selector: (T) -> R): T -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.BooleanArray.maxBy(selector: (kotlin.Boolean) -> R): kotlin.Boolean? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.BooleanArray.maxBy(selector: (kotlin.Boolean) -> R): kotlin.Boolean -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.ByteArray.maxBy(selector: (kotlin.Byte) -> R): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.ByteArray.maxBy(selector: (kotlin.Byte) -> R): kotlin.Byte -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.CharArray.maxBy(selector: (kotlin.Char) -> R): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.CharArray.maxBy(selector: (kotlin.Char) -> R): kotlin.Char -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.DoubleArray.maxBy(selector: (kotlin.Double) -> R): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.DoubleArray.maxBy(selector: (kotlin.Double) -> R): kotlin.Double -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.FloatArray.maxBy(selector: (kotlin.Float) -> R): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.FloatArray.maxBy(selector: (kotlin.Float) -> R): kotlin.Float -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.IntArray.maxBy(selector: (kotlin.Int) -> R): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.IntArray.maxBy(selector: (kotlin.Int) -> R): kotlin.Int -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.LongArray.maxBy(selector: (kotlin.Long) -> R): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.LongArray.maxBy(selector: (kotlin.Long) -> R): kotlin.Long -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.ShortArray.maxBy(selector: (kotlin.Short) -> R): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.ShortArray.maxBy(selector: (kotlin.Short) -> R): kotlin.Short -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UByteArray.maxBy(selector: (kotlin.UByte) -> R): kotlin.UByte? +public inline fun > kotlin.UByteArray.maxBy(selector: (kotlin.UByte) -> R): kotlin.UByte -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UIntArray.maxBy(selector: (kotlin.UInt) -> R): kotlin.UInt? +public inline fun > kotlin.UIntArray.maxBy(selector: (kotlin.UInt) -> R): kotlin.UInt -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.ULongArray.maxBy(selector: (kotlin.ULong) -> R): kotlin.ULong? +public inline fun > kotlin.ULongArray.maxBy(selector: (kotlin.ULong) -> R): kotlin.ULong -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UShortArray.maxBy(selector: (kotlin.UShort) -> R): kotlin.UShort? +public inline fun > kotlin.UShortArray.maxBy(selector: (kotlin.UShort) -> R): kotlin.UShort -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.collections.Iterable.maxBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.collections.Iterable.maxBy(selector: (T) -> R): T -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") @kotlin.internal.InlineOnly -public inline fun > kotlin.collections.Map.maxBy(selector: (kotlin.collections.Map.Entry) -> R): kotlin.collections.Map.Entry? +public inline fun > kotlin.collections.Map.maxBy(selector: (kotlin.collections.Map.Entry) -> R): kotlin.collections.Map.Entry @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.Array.maxByOrNull(selector: (T) -> R): T? @@ -5047,74 +5035,70 @@ public fun kotlin.collections.Iterable.maxOrNull(): kotlin.Double @kotlin.SinceKotlin(version = "1.4") public fun kotlin.collections.Iterable.maxOrNull(): kotlin.Float? -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.Array.maxWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.Array.maxWith(comparator: kotlin.Comparator): T -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.BooleanArray.maxWith(comparator: kotlin.Comparator): kotlin.Boolean? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.BooleanArray.maxWith(comparator: kotlin.Comparator): kotlin.Boolean -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ByteArray.maxWith(comparator: kotlin.Comparator): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.ByteArray.maxWith(comparator: kotlin.Comparator): kotlin.Byte -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharArray.maxWith(comparator: kotlin.Comparator): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.CharArray.maxWith(comparator: kotlin.Comparator): kotlin.Char -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.DoubleArray.maxWith(comparator: kotlin.Comparator): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.DoubleArray.maxWith(comparator: kotlin.Comparator): kotlin.Double -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.FloatArray.maxWith(comparator: kotlin.Comparator): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.FloatArray.maxWith(comparator: kotlin.Comparator): kotlin.Float -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.IntArray.maxWith(comparator: kotlin.Comparator): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.IntArray.maxWith(comparator: kotlin.Comparator): kotlin.Int -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.LongArray.maxWith(comparator: kotlin.Comparator): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.LongArray.maxWith(comparator: kotlin.Comparator): kotlin.Long -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ShortArray.maxWith(comparator: kotlin.Comparator): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.ShortArray.maxWith(comparator: kotlin.Comparator): kotlin.Short -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UByteArray.maxWith(comparator: kotlin.Comparator): kotlin.UByte? +public fun kotlin.UByteArray.maxWith(comparator: kotlin.Comparator): kotlin.UByte -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UIntArray.maxWith(comparator: kotlin.Comparator): kotlin.UInt? +public fun kotlin.UIntArray.maxWith(comparator: kotlin.Comparator): kotlin.UInt -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.ULongArray.maxWith(comparator: kotlin.Comparator): kotlin.ULong? +public fun kotlin.ULongArray.maxWith(comparator: kotlin.Comparator): kotlin.ULong -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UShortArray.maxWith(comparator: kotlin.Comparator): kotlin.UShort? +public fun kotlin.UShortArray.maxWith(comparator: kotlin.Comparator): kotlin.UShort -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.collections.Iterable.maxWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.collections.Iterable.maxWith(comparator: kotlin.Comparator): T -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") @kotlin.internal.InlineOnly -public inline fun kotlin.collections.Map.maxWith(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry? +public inline fun kotlin.collections.Map.maxWith(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry @kotlin.SinceKotlin(version = "1.4") public fun kotlin.Array.maxWithOrNull(comparator: kotlin.Comparator): T? @@ -5166,157 +5150,146 @@ public fun kotlin.collections.Iterable.maxWithOrNull(comparator: kotlin.C @kotlin.internal.InlineOnly public inline fun kotlin.collections.Map.maxWithOrNull(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry? -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.Array.min(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun > kotlin.Array.min(): T -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.Array.min(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.Array.min(): kotlin.Double -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.Array.min(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.Array.min(): kotlin.Float -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ByteArray.min(): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.ByteArray.min(): kotlin.Byte -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharArray.min(): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.CharArray.min(): kotlin.Char -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.DoubleArray.min(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.DoubleArray.min(): kotlin.Double -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.FloatArray.min(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.FloatArray.min(): kotlin.Float -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.IntArray.min(): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.IntArray.min(): kotlin.Int -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.LongArray.min(): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.LongArray.min(): kotlin.Long -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ShortArray.min(): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.ShortArray.min(): kotlin.Short -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UByteArray.min(): kotlin.UByte? +public fun kotlin.UByteArray.min(): kotlin.UByte -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UIntArray.min(): kotlin.UInt? +public fun kotlin.UIntArray.min(): kotlin.UInt -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.ULongArray.min(): kotlin.ULong? +public fun kotlin.ULongArray.min(): kotlin.ULong -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UShortArray.min(): kotlin.UShort? +public fun kotlin.UShortArray.min(): kotlin.UShort -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.collections.Iterable.min(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun > kotlin.collections.Iterable.min(): T -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.collections.Iterable.min(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.collections.Iterable.min(): kotlin.Double -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.collections.Iterable.min(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.collections.Iterable.min(): kotlin.Float -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.Array.minBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.Array.minBy(selector: (T) -> R): T -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.BooleanArray.minBy(selector: (kotlin.Boolean) -> R): kotlin.Boolean? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.BooleanArray.minBy(selector: (kotlin.Boolean) -> R): kotlin.Boolean -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.ByteArray.minBy(selector: (kotlin.Byte) -> R): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.ByteArray.minBy(selector: (kotlin.Byte) -> R): kotlin.Byte -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.CharArray.minBy(selector: (kotlin.Char) -> R): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.CharArray.minBy(selector: (kotlin.Char) -> R): kotlin.Char -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.DoubleArray.minBy(selector: (kotlin.Double) -> R): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.DoubleArray.minBy(selector: (kotlin.Double) -> R): kotlin.Double -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.FloatArray.minBy(selector: (kotlin.Float) -> R): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.FloatArray.minBy(selector: (kotlin.Float) -> R): kotlin.Float -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.IntArray.minBy(selector: (kotlin.Int) -> R): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.IntArray.minBy(selector: (kotlin.Int) -> R): kotlin.Int -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.LongArray.minBy(selector: (kotlin.Long) -> R): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.LongArray.minBy(selector: (kotlin.Long) -> R): kotlin.Long -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.ShortArray.minBy(selector: (kotlin.Short) -> R): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.ShortArray.minBy(selector: (kotlin.Short) -> R): kotlin.Short -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UByteArray.minBy(selector: (kotlin.UByte) -> R): kotlin.UByte? +public inline fun > kotlin.UByteArray.minBy(selector: (kotlin.UByte) -> R): kotlin.UByte -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UIntArray.minBy(selector: (kotlin.UInt) -> R): kotlin.UInt? +public inline fun > kotlin.UIntArray.minBy(selector: (kotlin.UInt) -> R): kotlin.UInt -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.ULongArray.minBy(selector: (kotlin.ULong) -> R): kotlin.ULong? +public inline fun > kotlin.ULongArray.minBy(selector: (kotlin.ULong) -> R): kotlin.ULong -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow-U") @kotlin.ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > kotlin.UShortArray.minBy(selector: (kotlin.UShort) -> R): kotlin.UShort? +public inline fun > kotlin.UShortArray.minBy(selector: (kotlin.UShort) -> R): kotlin.UShort -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.collections.Iterable.minBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.collections.Iterable.minBy(selector: (T) -> R): T -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.collections.Map.minBy(selector: (kotlin.collections.Map.Entry) -> R): kotlin.collections.Map.Entry? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +@kotlin.internal.InlineOnly +public inline fun > kotlin.collections.Map.minBy(selector: (kotlin.collections.Map.Entry) -> R): kotlin.collections.Map.Entry @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.Array.minByOrNull(selector: (T) -> R): T? @@ -6059,73 +6032,70 @@ public fun kotlin.collections.Iterable.minOrNull(): kotlin.Double @kotlin.SinceKotlin(version = "1.4") public fun kotlin.collections.Iterable.minOrNull(): kotlin.Float? -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.Array.minWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.Array.minWith(comparator: kotlin.Comparator): T -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.BooleanArray.minWith(comparator: kotlin.Comparator): kotlin.Boolean? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.BooleanArray.minWith(comparator: kotlin.Comparator): kotlin.Boolean -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ByteArray.minWith(comparator: kotlin.Comparator): kotlin.Byte? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.ByteArray.minWith(comparator: kotlin.Comparator): kotlin.Byte -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharArray.minWith(comparator: kotlin.Comparator): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.CharArray.minWith(comparator: kotlin.Comparator): kotlin.Char -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.DoubleArray.minWith(comparator: kotlin.Comparator): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.DoubleArray.minWith(comparator: kotlin.Comparator): kotlin.Double -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.FloatArray.minWith(comparator: kotlin.Comparator): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.FloatArray.minWith(comparator: kotlin.Comparator): kotlin.Float -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.IntArray.minWith(comparator: kotlin.Comparator): kotlin.Int? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.IntArray.minWith(comparator: kotlin.Comparator): kotlin.Int -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.LongArray.minWith(comparator: kotlin.Comparator): kotlin.Long? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.LongArray.minWith(comparator: kotlin.Comparator): kotlin.Long -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.ShortArray.minWith(comparator: kotlin.Comparator): kotlin.Short? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.ShortArray.minWith(comparator: kotlin.Comparator): kotlin.Short -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UByteArray.minWith(comparator: kotlin.Comparator): kotlin.UByte? +public fun kotlin.UByteArray.minWith(comparator: kotlin.Comparator): kotlin.UByte -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UIntArray.minWith(comparator: kotlin.Comparator): kotlin.UInt? +public fun kotlin.UIntArray.minWith(comparator: kotlin.Comparator): kotlin.UInt -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.ULongArray.minWith(comparator: kotlin.Comparator): kotlin.ULong? +public fun kotlin.ULongArray.minWith(comparator: kotlin.Comparator): kotlin.ULong -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.3") +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow-U") @kotlin.ExperimentalUnsignedTypes -public fun kotlin.UShortArray.minWith(comparator: kotlin.Comparator): kotlin.UShort? +public fun kotlin.UShortArray.minWith(comparator: kotlin.Comparator): kotlin.UShort -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.collections.Iterable.minWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.collections.Iterable.minWith(comparator: kotlin.Comparator): T -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.collections.Map.minWith(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +@kotlin.internal.InlineOnly +public inline fun kotlin.collections.Map.minWith(comparator: kotlin.Comparator>): kotlin.collections.Map.Entry @kotlin.SinceKotlin(version = "1.4") public fun kotlin.Array.minWithOrNull(comparator: kotlin.Comparator): T? diff --git a/libraries/stdlib/api/js/kotlin.sequences.kt b/libraries/stdlib/api/js/kotlin.sequences.kt index b61231639d6..6a844af4d5a 100644 --- a/libraries/stdlib/api/js/kotlin.sequences.kt +++ b/libraries/stdlib/api/js/kotlin.sequences.kt @@ -253,23 +253,21 @@ public inline fun > kotlin.sequences.Sequence.mapTo(destination: C, transform: (T) -> R): C -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.sequences.Sequence.max(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun > kotlin.sequences.Sequence.max(): T -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.sequences.Sequence.max(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.sequences.Sequence.max(): kotlin.Double -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.sequences.Sequence.max(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.sequences.Sequence.max(): kotlin.Float -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.sequences.Sequence.maxBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.sequences.Sequence.maxBy(selector: (T) -> R): T @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.sequences.Sequence.maxByOrNull(selector: (T) -> R): T? @@ -323,30 +321,28 @@ public fun kotlin.sequences.Sequence.maxOrNull(): kotlin.Double? @kotlin.SinceKotlin(version = "1.4") public fun kotlin.sequences.Sequence.maxOrNull(): kotlin.Float? -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.sequences.Sequence.maxWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.sequences.Sequence.maxWith(comparator: kotlin.Comparator): T @kotlin.SinceKotlin(version = "1.4") public fun kotlin.sequences.Sequence.maxWithOrNull(comparator: kotlin.Comparator): T? -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun > kotlin.sequences.Sequence.min(): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun > kotlin.sequences.Sequence.min(): T -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.sequences.Sequence.min(): kotlin.Double? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.sequences.Sequence.min(): kotlin.Double -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -@kotlin.SinceKotlin(version = "1.1") -public fun kotlin.sequences.Sequence.min(): kotlin.Float? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.sequences.Sequence.min(): kotlin.Float -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.sequences.Sequence.minBy(selector: (T) -> R): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.sequences.Sequence.minBy(selector: (T) -> R): T @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.sequences.Sequence.minByOrNull(selector: (T) -> R): T? @@ -400,9 +396,9 @@ public fun kotlin.sequences.Sequence.minOrNull(): kotlin.Double? @kotlin.SinceKotlin(version = "1.4") public fun kotlin.sequences.Sequence.minOrNull(): kotlin.Float? -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.sequences.Sequence.minWith(comparator: kotlin.Comparator): T? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.sequences.Sequence.minWith(comparator: kotlin.Comparator): T @kotlin.SinceKotlin(version = "1.4") public fun kotlin.sequences.Sequence.minWithOrNull(comparator: kotlin.Comparator): T? diff --git a/libraries/stdlib/api/js/kotlin.text.kt b/libraries/stdlib/api/js/kotlin.text.kt index 16e8bd7b6a8..5a246737cdf 100644 --- a/libraries/stdlib/api/js/kotlin.text.kt +++ b/libraries/stdlib/api/js/kotlin.text.kt @@ -490,13 +490,13 @@ public inline infix fun kotlin.CharSequence.matches(regex: kotlin.text.Regex): k @kotlin.DeprecatedSinceKotlin(warningSince = "1.6") public fun kotlin.String.matches(regex: kotlin.String): kotlin.Boolean -@kotlin.Deprecated(message = "Use maxOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharSequence.max(): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxOrThrow") +public fun kotlin.CharSequence.max(): kotlin.Char -@kotlin.Deprecated(message = "Use maxByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.CharSequence.maxBy(selector: (kotlin.Char) -> R): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxByOrThrow") +public inline fun > kotlin.CharSequence.maxBy(selector: (kotlin.Char) -> R): kotlin.Char @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.CharSequence.maxByOrNull(selector: (kotlin.Char) -> R): kotlin.Char? @@ -544,20 +544,20 @@ public inline fun kotlin.CharSequence.maxOfWithOrNull(comparator: kotlin.Com @kotlin.SinceKotlin(version = "1.4") public fun kotlin.CharSequence.maxOrNull(): kotlin.Char? -@kotlin.Deprecated(message = "Use maxWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.maxWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharSequence.maxWith(comparator: kotlin.Comparator): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "maxWithOrThrow") +public fun kotlin.CharSequence.maxWith(comparator: kotlin.Comparator): kotlin.Char @kotlin.SinceKotlin(version = "1.4") public fun kotlin.CharSequence.maxWithOrNull(comparator: kotlin.Comparator): kotlin.Char? -@kotlin.Deprecated(message = "Use minOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minOrNull()", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharSequence.min(): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minOrThrow") +public fun kotlin.CharSequence.min(): kotlin.Char -@kotlin.Deprecated(message = "Use minByOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minByOrNull(selector)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public inline fun > kotlin.CharSequence.minBy(selector: (kotlin.Char) -> R): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minByOrThrow") +public inline fun > kotlin.CharSequence.minBy(selector: (kotlin.Char) -> R): kotlin.Char @kotlin.SinceKotlin(version = "1.4") public inline fun > kotlin.CharSequence.minByOrNull(selector: (kotlin.Char) -> R): kotlin.Char? @@ -605,9 +605,9 @@ public inline fun kotlin.CharSequence.minOfWithOrNull(comparator: kotlin.Com @kotlin.SinceKotlin(version = "1.4") public fun kotlin.CharSequence.minOrNull(): kotlin.Char? -@kotlin.Deprecated(message = "Use minWithOrNull instead.", replaceWith = kotlin.ReplaceWith(expression = "this.minWithOrNull(comparator)", imports = {})) -@kotlin.DeprecatedSinceKotlin(errorSince = "1.5", hiddenSince = "1.6", warningSince = "1.4") -public fun kotlin.CharSequence.minWith(comparator: kotlin.Comparator): kotlin.Char? +@kotlin.SinceKotlin(version = "1.7") +@kotlin.jvm.JvmName(name = "minWithOrThrow") +public fun kotlin.CharSequence.minWith(comparator: kotlin.Comparator): kotlin.Char @kotlin.SinceKotlin(version = "1.4") public fun kotlin.CharSequence.minWithOrNull(comparator: kotlin.Comparator): kotlin.Char? diff --git a/libraries/stdlib/common/src/generated/_Arrays.kt b/libraries/stdlib/common/src/generated/_Arrays.kt index 0ba540452f3..c03583a156e 100644 --- a/libraries/stdlib/common/src/generated/_Arrays.kt +++ b/libraries/stdlib/common/src/generated/_Arrays.kt @@ -13691,120 +13691,435 @@ public inline fun CharArray.forEachIndexed(action: (index: Int, Char) -> Unit): for (item in this) action(index++, item) } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Array.max(): Double? { - return maxOrNull() +/** + * Returns the largest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.max(): Double { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + max = maxOf(max, e) + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Array.max(): Float? { - return maxOrNull() +/** + * Returns the largest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.max(): Float { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + max = maxOf(max, e) + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun > Array.max(): T? { - return maxOrNull() +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Array.max(): T { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun ByteArray.max(): Byte? { - return maxOrNull() +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun ByteArray.max(): Byte { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun ShortArray.max(): Short? { - return maxOrNull() +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun ShortArray.max(): Short { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun IntArray.max(): Int? { - return maxOrNull() +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun IntArray.max(): Int { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun LongArray.max(): Long? { - return maxOrNull() +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun LongArray.max(): Long { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun FloatArray.max(): Float? { - return maxOrNull() +/** + * Returns the largest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun FloatArray.max(): Float { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + max = maxOf(max, e) + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun DoubleArray.max(): Double? { - return maxOrNull() +/** + * Returns the largest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun DoubleArray.max(): Double { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + max = maxOf(max, e) + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun CharArray.max(): Char? { - return maxOrNull() +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharArray.max(): Char { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > Array.maxBy(selector: (T) -> R): T? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Array.maxBy(selector: (T) -> R): T { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > ByteArray.maxBy(selector: (Byte) -> R): Byte? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ByteArray.maxBy(selector: (Byte) -> R): Byte { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > ShortArray.maxBy(selector: (Short) -> R): Short? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ShortArray.maxBy(selector: (Short) -> R): Short { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > IntArray.maxBy(selector: (Int) -> R): Int? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > IntArray.maxBy(selector: (Int) -> R): Int { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > LongArray.maxBy(selector: (Long) -> R): Long? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > LongArray.maxBy(selector: (Long) -> R): Long { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > FloatArray.maxBy(selector: (Float) -> R): Float? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > FloatArray.maxBy(selector: (Float) -> R): Float { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > DoubleArray.maxBy(selector: (Double) -> R): Double? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > DoubleArray.maxBy(selector: (Double) -> R): Double { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > BooleanArray.maxBy(selector: (Boolean) -> R): Boolean? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > BooleanArray.maxBy(selector: (Boolean) -> R): Boolean { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > CharArray.maxBy(selector: (Char) -> R): Char? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > CharArray.maxBy(selector: (Char) -> R): Char { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } /** @@ -15674,58 +15989,166 @@ public fun CharArray.maxOrNull(): Char? { return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun Array.maxWith(comparator: Comparator): T? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.maxWith(comparator: Comparator): T { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun ByteArray.maxWith(comparator: Comparator): Byte? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun ByteArray.maxWith(comparator: Comparator): Byte { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun ShortArray.maxWith(comparator: Comparator): Short? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun ShortArray.maxWith(comparator: Comparator): Short { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun IntArray.maxWith(comparator: Comparator): Int? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun IntArray.maxWith(comparator: Comparator): Int { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun LongArray.maxWith(comparator: Comparator): Long? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun LongArray.maxWith(comparator: Comparator): Long { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun FloatArray.maxWith(comparator: Comparator): Float? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun FloatArray.maxWith(comparator: Comparator): Float { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun DoubleArray.maxWith(comparator: Comparator): Double? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun DoubleArray.maxWith(comparator: Comparator): Double { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun BooleanArray.maxWith(comparator: Comparator): Boolean? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun BooleanArray.maxWith(comparator: Comparator): Boolean { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun CharArray.maxWith(comparator: Comparator): Char? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharArray.maxWith(comparator: Comparator): Char { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } /** @@ -15854,120 +16277,435 @@ public fun CharArray.maxWithOrNull(comparator: Comparator): Char? { return max } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Array.min(): Double? { - return minOrNull() +/** + * Returns the smallest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.min(): Double { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + min = minOf(min, e) + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Array.min(): Float? { - return minOrNull() +/** + * Returns the smallest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.min(): Float { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + min = minOf(min, e) + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun > Array.min(): T? { - return minOrNull() +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Array.min(): T { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun ByteArray.min(): Byte? { - return minOrNull() +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun ByteArray.min(): Byte { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun ShortArray.min(): Short? { - return minOrNull() +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun ShortArray.min(): Short { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun IntArray.min(): Int? { - return minOrNull() +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun IntArray.min(): Int { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun LongArray.min(): Long? { - return minOrNull() +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun LongArray.min(): Long { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun FloatArray.min(): Float? { - return minOrNull() +/** + * Returns the smallest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun FloatArray.min(): Float { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + min = minOf(min, e) + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun DoubleArray.min(): Double? { - return minOrNull() +/** + * Returns the smallest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun DoubleArray.min(): Double { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + min = minOf(min, e) + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun CharArray.min(): Char? { - return minOrNull() +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharArray.min(): Char { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > Array.minBy(selector: (T) -> R): T? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Array.minBy(selector: (T) -> R): T { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > ByteArray.minBy(selector: (Byte) -> R): Byte? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ByteArray.minBy(selector: (Byte) -> R): Byte { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > ShortArray.minBy(selector: (Short) -> R): Short? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ShortArray.minBy(selector: (Short) -> R): Short { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > IntArray.minBy(selector: (Int) -> R): Int? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > IntArray.minBy(selector: (Int) -> R): Int { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > LongArray.minBy(selector: (Long) -> R): Long? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > LongArray.minBy(selector: (Long) -> R): Long { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > FloatArray.minBy(selector: (Float) -> R): Float? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > FloatArray.minBy(selector: (Float) -> R): Float { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > DoubleArray.minBy(selector: (Double) -> R): Double? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > DoubleArray.minBy(selector: (Double) -> R): Double { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > BooleanArray.minBy(selector: (Boolean) -> R): Boolean? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > BooleanArray.minBy(selector: (Boolean) -> R): Boolean { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > CharArray.minBy(selector: (Char) -> R): Char? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > CharArray.minBy(selector: (Char) -> R): Char { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } /** @@ -17837,58 +18575,166 @@ public fun CharArray.minOrNull(): Char? { return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun Array.minWith(comparator: Comparator): T? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.minWith(comparator: Comparator): T { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun ByteArray.minWith(comparator: Comparator): Byte? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun ByteArray.minWith(comparator: Comparator): Byte { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun ShortArray.minWith(comparator: Comparator): Short? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun ShortArray.minWith(comparator: Comparator): Short { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun IntArray.minWith(comparator: Comparator): Int? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun IntArray.minWith(comparator: Comparator): Int { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun LongArray.minWith(comparator: Comparator): Long? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun LongArray.minWith(comparator: Comparator): Long { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun FloatArray.minWith(comparator: Comparator): Float? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun FloatArray.minWith(comparator: Comparator): Float { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun DoubleArray.minWith(comparator: Comparator): Double? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun DoubleArray.minWith(comparator: Comparator): Double { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun BooleanArray.minWith(comparator: Comparator): Boolean? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun BooleanArray.minWith(comparator: Comparator): Boolean { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun CharArray.minWith(comparator: Comparator): Char? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharArray.minWith(comparator: Comparator): Char { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } /** diff --git a/libraries/stdlib/common/src/generated/_Collections.kt b/libraries/stdlib/common/src/generated/_Collections.kt index 02e04194720..149f9b4b304 100644 --- a/libraries/stdlib/common/src/generated/_Collections.kt +++ b/libraries/stdlib/common/src/generated/_Collections.kt @@ -1861,30 +1861,92 @@ public inline fun Iterable.forEachIndexed(action: (index: Int, T) -> Unit for (item in this) action(checkIndexOverflow(index++), item) } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Iterable.max(): Double? { - return maxOrNull() +/** + * Returns the largest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the collection is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.max(): Double { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var max = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + max = maxOf(max, e) + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Iterable.max(): Float? { - return maxOrNull() +/** + * Returns the largest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the collection is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.max(): Float { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var max = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + max = maxOf(max, e) + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun > Iterable.max(): T? { - return maxOrNull() +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the collection is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Iterable.max(): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var max = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + if (max < e) max = e + } + return max } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > Iterable.maxBy(selector: (T) -> R): T? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the collection is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Iterable.maxBy(selector: (T) -> R): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var maxElem = iterator.next() + if (!iterator.hasNext()) return maxElem + var maxValue = selector(maxElem) + do { + val e = iterator.next() + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } while (iterator.hasNext()) + return maxElem } /** @@ -2135,10 +2197,23 @@ public fun > Iterable.maxOrNull(): T? { return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun Iterable.maxWith(comparator: Comparator): T? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the collection is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.maxWith(comparator: Comparator): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var max = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + if (comparator.compare(max, e) < 0) max = e + } + return max } /** @@ -2156,30 +2231,92 @@ public fun Iterable.maxWithOrNull(comparator: Comparator): T? { return max } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Iterable.min(): Double? { - return minOrNull() +/** + * Returns the smallest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the collection is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.min(): Double { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var min = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + min = minOf(min, e) + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Iterable.min(): Float? { - return minOrNull() +/** + * Returns the smallest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * @throws NoSuchElementException if the collection is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.min(): Float { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var min = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + min = minOf(min, e) + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun > Iterable.min(): T? { - return minOrNull() +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the collection is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Iterable.min(): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var min = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + if (min > e) min = e + } + return min } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > Iterable.minBy(selector: (T) -> R): T? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the collection is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Iterable.minBy(selector: (T) -> R): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var minElem = iterator.next() + if (!iterator.hasNext()) return minElem + var minValue = selector(minElem) + do { + val e = iterator.next() + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } while (iterator.hasNext()) + return minElem } /** @@ -2430,10 +2567,23 @@ public fun > Iterable.minOrNull(): T? { return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun Iterable.minWith(comparator: Comparator): T? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the collection is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.minWith(comparator: Comparator): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var min = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + if (comparator.compare(min, e) > 0) min = e + } + return min } /** diff --git a/libraries/stdlib/common/src/generated/_Maps.kt b/libraries/stdlib/common/src/generated/_Maps.kt index b857bd3670a..a11c6219779 100644 --- a/libraries/stdlib/common/src/generated/_Maps.kt +++ b/libraries/stdlib/common/src/generated/_Maps.kt @@ -211,11 +211,19 @@ public inline fun Map.forEach(action: (Map.Entry) -> Unit for (element in this) action(element) } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +/** + * Returns the first entry yielding the largest value of the given function. + * + * @throws NoSuchElementException if the map is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") @kotlin.internal.InlineOnly -public inline fun > Map.maxBy(selector: (Map.Entry) -> R): Map.Entry? { - return maxByOrNull(selector) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Map.maxBy(selector: (Map.Entry) -> R): Map.Entry { + return entries.maxBy(selector) } /** @@ -341,11 +349,17 @@ public inline fun Map.maxOfWithOrNull(comparator: Comparator return entries.maxOfWithOrNull(comparator, selector) } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +/** + * Returns the first entry having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the map is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") @kotlin.internal.InlineOnly -public inline fun Map.maxWith(comparator: Comparator>): Map.Entry? { - return maxWithOrNull(comparator) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun Map.maxWith(comparator: Comparator>): Map.Entry { + return entries.maxWith(comparator) } /** @@ -357,10 +371,19 @@ public inline fun Map.maxWithOrNull(comparator: Comparator> Map.minBy(selector: (Map.Entry) -> R): Map.Entry? { - return minByOrNull(selector) +/** + * Returns the first entry yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the map is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Map.minBy(selector: (Map.Entry) -> R): Map.Entry { + return entries.minBy(selector) } /** @@ -486,10 +509,17 @@ public inline fun Map.minOfWithOrNull(comparator: Comparator return entries.minOfWithOrNull(comparator, selector) } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun Map.minWith(comparator: Comparator>): Map.Entry? { - return minWithOrNull(comparator) +/** + * Returns the first entry having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the map is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun Map.minWith(comparator: Comparator>): Map.Entry { + return entries.minWith(comparator) } /** diff --git a/libraries/stdlib/common/src/generated/_Sequences.kt b/libraries/stdlib/common/src/generated/_Sequences.kt index 0cccad66dc4..10cfa809ba8 100644 --- a/libraries/stdlib/common/src/generated/_Sequences.kt +++ b/libraries/stdlib/common/src/generated/_Sequences.kt @@ -1303,30 +1303,100 @@ public inline fun Sequence.forEachIndexed(action: (index: Int, T) -> Unit for (item in this) action(checkIndexOverflow(index++), item) } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Sequence.max(): Double? { - return maxOrNull() +/** + * Returns the largest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.max(): Double { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var max = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + max = maxOf(max, e) + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Sequence.max(): Float? { - return maxOrNull() +/** + * Returns the largest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.max(): Float { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var max = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + max = maxOf(max, e) + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun > Sequence.max(): T? { - return maxOrNull() +/** + * Returns the largest element. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Sequence.max(): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var max = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + if (max < e) max = e + } + return max } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > Sequence.maxBy(selector: (T) -> R): T? { - return maxByOrNull(selector) +/** + * Returns the first element yielding the largest value of the given function. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Sequence.maxBy(selector: (T) -> R): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var maxElem = iterator.next() + if (!iterator.hasNext()) return maxElem + var maxValue = selector(maxElem) + do { + val e = iterator.next() + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } while (iterator.hasNext()) + return maxElem } /** @@ -1359,10 +1429,10 @@ public inline fun > Sequence.maxByOrNull(selector: (T) - * applied to each element in the sequence. * * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`. - * - * @throws NoSuchElementException if the sequence is empty. * * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. */ @SinceKotlin("1.4") @OptIn(kotlin.experimental.ExperimentalTypeInference::class) @@ -1384,10 +1454,10 @@ public inline fun Sequence.maxOf(selector: (T) -> Double): Double { * applied to each element in the sequence. * * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`. - * - * @throws NoSuchElementException if the sequence is empty. * * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. */ @SinceKotlin("1.4") @OptIn(kotlin.experimental.ExperimentalTypeInference::class) @@ -1407,10 +1477,10 @@ public inline fun Sequence.maxOf(selector: (T) -> Float): Float { /** * Returns the largest value among all values produced by [selector] function * applied to each element in the sequence. - * - * @throws NoSuchElementException if the sequence is empty. * * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. */ @SinceKotlin("1.4") @OptIn(kotlin.experimental.ExperimentalTypeInference::class) @@ -1601,10 +1671,25 @@ public fun > Sequence.maxOrNull(): T? { return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun Sequence.maxWith(comparator: Comparator): T? { - return maxWithOrNull(comparator) +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.maxWith(comparator: Comparator): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var max = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + if (comparator.compare(max, e) < 0) max = e + } + return max } /** @@ -1624,30 +1709,100 @@ public fun Sequence.maxWithOrNull(comparator: Comparator): T? { return max } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Sequence.min(): Double? { - return minOrNull() +/** + * Returns the smallest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.min(): Double { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var min = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + min = minOf(min, e) + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.1") -public fun Sequence.min(): Float? { - return minOrNull() +/** + * Returns the smallest element. + * + * If any of elements is `NaN` returns `NaN`. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.min(): Float { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var min = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + min = minOf(min, e) + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun > Sequence.min(): T? { - return minOrNull() +/** + * Returns the smallest element. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Sequence.min(): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var min = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + if (min > e) min = e + } + return min } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > Sequence.minBy(selector: (T) -> R): T? { - return minByOrNull(selector) +/** + * Returns the first element yielding the smallest value of the given function. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Sequence.minBy(selector: (T) -> R): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var minElem = iterator.next() + if (!iterator.hasNext()) return minElem + var minValue = selector(minElem) + do { + val e = iterator.next() + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } while (iterator.hasNext()) + return minElem } /** @@ -1680,10 +1835,10 @@ public inline fun > Sequence.minByOrNull(selector: (T) - * applied to each element in the sequence. * * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`. - * - * @throws NoSuchElementException if the sequence is empty. * * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. */ @SinceKotlin("1.4") @OptIn(kotlin.experimental.ExperimentalTypeInference::class) @@ -1705,10 +1860,10 @@ public inline fun Sequence.minOf(selector: (T) -> Double): Double { * applied to each element in the sequence. * * If any of values produced by [selector] function is `NaN`, the returned result is `NaN`. - * - * @throws NoSuchElementException if the sequence is empty. * * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. */ @SinceKotlin("1.4") @OptIn(kotlin.experimental.ExperimentalTypeInference::class) @@ -1728,10 +1883,10 @@ public inline fun Sequence.minOf(selector: (T) -> Float): Float { /** * Returns the smallest value among all values produced by [selector] function * applied to each element in the sequence. - * - * @throws NoSuchElementException if the sequence is empty. * * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. */ @SinceKotlin("1.4") @OptIn(kotlin.experimental.ExperimentalTypeInference::class) @@ -1922,10 +2077,25 @@ public fun > Sequence.minOrNull(): T? { return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun Sequence.minWith(comparator: Comparator): T? { - return minWithOrNull(comparator) +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * The operation is _terminal_. + * + * @throws NoSuchElementException if the sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.minWith(comparator: Comparator): T { + val iterator = iterator() + if (!iterator.hasNext()) throw NoSuchElementException() + var min = iterator.next() + while (iterator.hasNext()) { + val e = iterator.next() + if (comparator.compare(min, e) > 0) min = e + } + return min } /** diff --git a/libraries/stdlib/common/src/generated/_Strings.kt b/libraries/stdlib/common/src/generated/_Strings.kt index 65809a1eee2..4febfcf2cec 100644 --- a/libraries/stdlib/common/src/generated/_Strings.kt +++ b/libraries/stdlib/common/src/generated/_Strings.kt @@ -1180,16 +1180,49 @@ public inline fun CharSequence.forEachIndexed(action: (index: Int, Char) -> Unit for (item in this) action(index++, item) } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun CharSequence.max(): Char? { - return maxOrNull() +/** + * Returns the largest character. + * + * @throws NoSuchElementException if the char sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharSequence.max(): Char { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > CharSequence.maxBy(selector: (Char) -> R): Char? { - return maxByOrNull(selector) +/** + * Returns the first character yielding the largest value of the given function. + * + * @throws NoSuchElementException if the char sequence is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > CharSequence.maxBy(selector: (Char) -> R): Char { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } /** @@ -1397,10 +1430,22 @@ public fun CharSequence.maxOrNull(): Char? { return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun CharSequence.maxWith(comparator: Comparator): Char? { - return maxWithOrNull(comparator) +/** + * Returns the first character having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the char sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharSequence.maxWith(comparator: Comparator): Char { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } /** @@ -1417,16 +1462,49 @@ public fun CharSequence.maxWithOrNull(comparator: Comparator): Char? { return max } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun CharSequence.min(): Char? { - return minOrNull() +/** + * Returns the smallest character. + * + * @throws NoSuchElementException if the char sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharSequence.min(): Char { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public inline fun > CharSequence.minBy(selector: (Char) -> R): Char? { - return minByOrNull(selector) +/** + * Returns the first character yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the char sequence is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > CharSequence.minBy(selector: (Char) -> R): Char { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } /** @@ -1634,10 +1712,22 @@ public fun CharSequence.minOrNull(): Char? { return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -public fun CharSequence.minWith(comparator: Comparator): Char? { - return minWithOrNull(comparator) +/** + * Returns the first character having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the char sequence is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharSequence.minWith(comparator: Comparator): Char { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } /** diff --git a/libraries/stdlib/common/src/generated/_UArrays.kt b/libraries/stdlib/common/src/generated/_UArrays.kt index 35f23c59d45..4e5f7a527d0 100644 --- a/libraries/stdlib/common/src/generated/_UArrays.kt +++ b/libraries/stdlib/common/src/generated/_UArrays.kt @@ -5946,72 +5946,196 @@ public inline fun UShortArray.forEachIndexed(action: (index: Int, UShort) -> Uni for (item in this) action(index++, item) } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow-U") @ExperimentalUnsignedTypes -public fun UIntArray.max(): UInt? { - return maxOrNull() +@Suppress("CONFLICTING_OVERLOADS") +public fun UIntArray.max(): UInt { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow-U") @ExperimentalUnsignedTypes -public fun ULongArray.max(): ULong? { - return maxOrNull() +@Suppress("CONFLICTING_OVERLOADS") +public fun ULongArray.max(): ULong { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow-U") @ExperimentalUnsignedTypes -public fun UByteArray.max(): UByte? { - return maxOrNull() +@Suppress("CONFLICTING_OVERLOADS") +public fun UByteArray.max(): UByte { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the largest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxOrThrow-U") @ExperimentalUnsignedTypes -public fun UShortArray.max(): UShort? { - return maxOrNull() +@Suppress("CONFLICTING_OVERLOADS") +public fun UShortArray.max(): UShort { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (max < e) max = e + } + return max } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow-U") @ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > UIntArray.maxBy(selector: (UInt) -> R): UInt? { - return maxByOrNull(selector) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UIntArray.maxBy(selector: (UInt) -> R): UInt { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow-U") @ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > ULongArray.maxBy(selector: (ULong) -> R): ULong? { - return maxByOrNull(selector) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ULongArray.maxBy(selector: (ULong) -> R): ULong { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow-U") @ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > UByteArray.maxBy(selector: (UByte) -> R): UByte? { - return maxByOrNull(selector) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UByteArray.maxBy(selector: (UByte) -> R): UByte { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } -@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element yielding the largest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.maxBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxByOrThrow-U") @ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > UShortArray.maxBy(selector: (UShort) -> R): UShort? { - return maxByOrNull(selector) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UShortArray.maxBy(selector: (UShort) -> R): UShort { + if (isEmpty()) throw NoSuchElementException() + var maxElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return maxElem + var maxValue = selector(maxElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (maxValue < v) { + maxElem = e + maxValue = v + } + } + return maxElem } /** @@ -6878,36 +7002,80 @@ public fun UShortArray.maxOrNull(): UShort? { return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow-U") @ExperimentalUnsignedTypes -public fun UIntArray.maxWith(comparator: Comparator): UInt? { - return maxWithOrNull(comparator) +@Suppress("CONFLICTING_OVERLOADS") +public fun UIntArray.maxWith(comparator: Comparator): UInt { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow-U") @ExperimentalUnsignedTypes -public fun ULongArray.maxWith(comparator: Comparator): ULong? { - return maxWithOrNull(comparator) +@Suppress("CONFLICTING_OVERLOADS") +public fun ULongArray.maxWith(comparator: Comparator): ULong { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow-U") @ExperimentalUnsignedTypes -public fun UByteArray.maxWith(comparator: Comparator): UByte? { - return maxWithOrNull(comparator) +@Suppress("CONFLICTING_OVERLOADS") +public fun UByteArray.maxWith(comparator: Comparator): UByte { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } -@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element having the largest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("maxWithOrThrow-U") @ExperimentalUnsignedTypes -public fun UShortArray.maxWith(comparator: Comparator): UShort? { - return maxWithOrNull(comparator) +@Suppress("CONFLICTING_OVERLOADS") +public fun UShortArray.maxWith(comparator: Comparator): UShort { + if (isEmpty()) throw NoSuchElementException() + var max = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(max, e) < 0) max = e + } + return max } /** @@ -6970,72 +7138,196 @@ public fun UShortArray.maxWithOrNull(comparator: Comparator): UShort? return max } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow-U") @ExperimentalUnsignedTypes -public fun UIntArray.min(): UInt? { - return minOrNull() +@Suppress("CONFLICTING_OVERLOADS") +public fun UIntArray.min(): UInt { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow-U") @ExperimentalUnsignedTypes -public fun ULongArray.min(): ULong? { - return minOrNull() +@Suppress("CONFLICTING_OVERLOADS") +public fun ULongArray.min(): ULong { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow-U") @ExperimentalUnsignedTypes -public fun UByteArray.min(): UByte? { - return minOrNull() +@Suppress("CONFLICTING_OVERLOADS") +public fun UByteArray.min(): UByte { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the smallest element. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minOrThrow-U") @ExperimentalUnsignedTypes -public fun UShortArray.min(): UShort? { - return minOrNull() +@Suppress("CONFLICTING_OVERLOADS") +public fun UShortArray.min(): UShort { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (min > e) min = e + } + return min } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow-U") @ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > UIntArray.minBy(selector: (UInt) -> R): UInt? { - return minByOrNull(selector) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UIntArray.minBy(selector: (UInt) -> R): UInt { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow-U") @ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > ULongArray.minBy(selector: (ULong) -> R): ULong? { - return minByOrNull(selector) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ULongArray.minBy(selector: (ULong) -> R): ULong { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow-U") @ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > UByteArray.minBy(selector: (UByte) -> R): UByte? { - return minByOrNull(selector) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UByteArray.minBy(selector: (UByte) -> R): UByte { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } -@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element yielding the smallest value of the given function. + * + * @throws NoSuchElementException if the array is empty. + * + * @sample samples.collections.Collections.Aggregates.minBy + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minByOrThrow-U") @ExperimentalUnsignedTypes @kotlin.internal.InlineOnly -public inline fun > UShortArray.minBy(selector: (UShort) -> R): UShort? { - return minByOrNull(selector) +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UShortArray.minBy(selector: (UShort) -> R): UShort { + if (isEmpty()) throw NoSuchElementException() + var minElem = this[0] + val lastIndex = this.lastIndex + if (lastIndex == 0) return minElem + var minValue = selector(minElem) + for (i in 1..lastIndex) { + val e = this[i] + val v = selector(e) + if (minValue > v) { + minElem = e + minValue = v + } + } + return minElem } /** @@ -7902,36 +8194,80 @@ public fun UShortArray.minOrNull(): UShort? { return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow-U") @ExperimentalUnsignedTypes -public fun UIntArray.minWith(comparator: Comparator): UInt? { - return minWithOrNull(comparator) +@Suppress("CONFLICTING_OVERLOADS") +public fun UIntArray.minWith(comparator: Comparator): UInt { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow-U") @ExperimentalUnsignedTypes -public fun ULongArray.minWith(comparator: Comparator): ULong? { - return minWithOrNull(comparator) +@Suppress("CONFLICTING_OVERLOADS") +public fun ULongArray.minWith(comparator: Comparator): ULong { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow-U") @ExperimentalUnsignedTypes -public fun UByteArray.minWith(comparator: Comparator): UByte? { - return minWithOrNull(comparator) +@Suppress("CONFLICTING_OVERLOADS") +public fun UByteArray.minWith(comparator: Comparator): UByte { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } -@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) -@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") -@SinceKotlin("1.3") +/** + * Returns the first element having the smallest value according to the provided [comparator]. + * + * @throws NoSuchElementException if the array is empty. + */ +@SinceKotlin("1.7") +@kotlin.jvm.JvmName("minWithOrThrow-U") @ExperimentalUnsignedTypes -public fun UShortArray.minWith(comparator: Comparator): UShort? { - return minWithOrNull(comparator) +@Suppress("CONFLICTING_OVERLOADS") +public fun UShortArray.minWith(comparator: Comparator): UShort { + if (isEmpty()) throw NoSuchElementException() + var min = this[0] + for (i in 1..lastIndex) { + val e = this[i] + if (comparator.compare(min, e) > 0) min = e + } + return min } /** diff --git a/libraries/stdlib/jvm/src/generated/_ArraysJvm.kt b/libraries/stdlib/jvm/src/generated/_ArraysJvm.kt index 22af6593a12..de455573c69 100644 --- a/libraries/stdlib/jvm/src/generated/_ArraysJvm.kt +++ b/libraries/stdlib/jvm/src/generated/_ArraysJvm.kt @@ -2733,6 +2733,402 @@ public fun Array.toSortedSet(comparator: Comparator): java.util return toCollection(java.util.TreeSet(comparator)) } +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.max(): Double? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.max(): Float? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Array.max(): T? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun ByteArray.max(): Byte? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun ShortArray.max(): Short? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun IntArray.max(): Int? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun LongArray.max(): Long? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun FloatArray.max(): Float? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun DoubleArray.max(): Double? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharArray.max(): Char? { + return maxOrNull() +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Array.maxBy(selector: (T) -> R): T? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ByteArray.maxBy(selector: (Byte) -> R): Byte? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ShortArray.maxBy(selector: (Short) -> R): Short? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > IntArray.maxBy(selector: (Int) -> R): Int? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > LongArray.maxBy(selector: (Long) -> R): Long? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > FloatArray.maxBy(selector: (Float) -> R): Float? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > DoubleArray.maxBy(selector: (Double) -> R): Double? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > BooleanArray.maxBy(selector: (Boolean) -> R): Boolean? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > CharArray.maxBy(selector: (Char) -> R): Char? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.maxWith(comparator: Comparator): T? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun ByteArray.maxWith(comparator: Comparator): Byte? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun ShortArray.maxWith(comparator: Comparator): Short? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun IntArray.maxWith(comparator: Comparator): Int? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun LongArray.maxWith(comparator: Comparator): Long? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun FloatArray.maxWith(comparator: Comparator): Float? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun DoubleArray.maxWith(comparator: Comparator): Double? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun BooleanArray.maxWith(comparator: Comparator): Boolean? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharArray.maxWith(comparator: Comparator): Char? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.min(): Double? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.min(): Float? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Array.min(): T? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun ByteArray.min(): Byte? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun ShortArray.min(): Short? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun IntArray.min(): Int? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun LongArray.min(): Long? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun FloatArray.min(): Float? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun DoubleArray.min(): Double? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharArray.min(): Char? { + return minOrNull() +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Array.minBy(selector: (T) -> R): T? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ByteArray.minBy(selector: (Byte) -> R): Byte? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ShortArray.minBy(selector: (Short) -> R): Short? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > IntArray.minBy(selector: (Int) -> R): Int? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > LongArray.minBy(selector: (Long) -> R): Long? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > FloatArray.minBy(selector: (Float) -> R): Float? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > DoubleArray.minBy(selector: (Double) -> R): Double? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > BooleanArray.minBy(selector: (Boolean) -> R): Boolean? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > CharArray.minBy(selector: (Char) -> R): Char? { + return minByOrNull(selector) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun Array.minWith(comparator: Comparator): T? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun ByteArray.minWith(comparator: Comparator): Byte? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun ShortArray.minWith(comparator: Comparator): Short? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun IntArray.minWith(comparator: Comparator): Int? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun LongArray.minWith(comparator: Comparator): Long? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun FloatArray.minWith(comparator: Comparator): Float? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun DoubleArray.minWith(comparator: Comparator): Double? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun BooleanArray.minWith(comparator: Comparator): Boolean? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharArray.minWith(comparator: Comparator): Char? { + return minWithOrNull(comparator) +} + /** * Returns the sum of all values produced by [selector] function applied to each element in the array. */ diff --git a/libraries/stdlib/jvm/src/generated/_CollectionsJvm.kt b/libraries/stdlib/jvm/src/generated/_CollectionsJvm.kt index 2669f3876d1..22cd6574536 100644 --- a/libraries/stdlib/jvm/src/generated/_CollectionsJvm.kt +++ b/libraries/stdlib/jvm/src/generated/_CollectionsJvm.kt @@ -59,6 +59,80 @@ public fun Iterable.toSortedSet(comparator: Comparator): java.util. return toCollection(java.util.TreeSet(comparator)) } +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.max(): Double? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.max(): Float? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Iterable.max(): T? { + return maxOrNull() +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Iterable.maxBy(selector: (T) -> R): T? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.maxWith(comparator: Comparator): T? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.min(): Double? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.min(): Float? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Iterable.min(): T? { + return minOrNull() +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Iterable.minBy(selector: (T) -> R): T? { + return minByOrNull(selector) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun Iterable.minWith(comparator: Comparator): T? { + return minWithOrNull(comparator) +} + /** * Returns the sum of all values produced by [selector] function applied to each element in the collection. */ diff --git a/libraries/stdlib/jvm/src/generated/_MapsJvm.kt b/libraries/stdlib/jvm/src/generated/_MapsJvm.kt new file mode 100644 index 00000000000..c21cc0720e5 --- /dev/null +++ b/libraries/stdlib/jvm/src/generated/_MapsJvm.kt @@ -0,0 +1,48 @@ +/* + * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +@file:kotlin.jvm.JvmMultifileClass +@file:kotlin.jvm.JvmName("MapsKt") + +package kotlin.collections + +// +// NOTE: THIS FILE IS AUTO-GENERATED by the GenerateStandardLib.kt +// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib +// + +import kotlin.ranges.contains +import kotlin.ranges.reversed + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Map.maxBy(selector: (Map.Entry) -> R): Map.Entry? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun Map.maxWith(comparator: Comparator>): Map.Entry? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Map.minBy(selector: (Map.Entry) -> R): Map.Entry? { + return minByOrNull(selector) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun Map.minWith(comparator: Comparator>): Map.Entry? { + return minWithOrNull(comparator) +} + diff --git a/libraries/stdlib/jvm/src/generated/_SequencesJvm.kt b/libraries/stdlib/jvm/src/generated/_SequencesJvm.kt index 3a0f6d4c491..72befee2475 100644 --- a/libraries/stdlib/jvm/src/generated/_SequencesJvm.kt +++ b/libraries/stdlib/jvm/src/generated/_SequencesJvm.kt @@ -59,6 +59,80 @@ public fun Sequence.toSortedSet(comparator: Comparator): java.util. return toCollection(java.util.TreeSet(comparator)) } +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.max(): Double? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.max(): Float? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Sequence.max(): T? { + return maxOrNull() +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Sequence.maxBy(selector: (T) -> R): T? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.maxWith(comparator: Comparator): T? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.min(): Double? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.1") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.min(): Float? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun > Sequence.min(): T? { + return minOrNull() +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > Sequence.minBy(selector: (T) -> R): T? { + return minByOrNull(selector) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun Sequence.minWith(comparator: Comparator): T? { + return minWithOrNull(comparator) +} + /** * Returns the sum of all values produced by [selector] function applied to each element in the sequence. * diff --git a/libraries/stdlib/jvm/src/generated/_StringsJvm.kt b/libraries/stdlib/jvm/src/generated/_StringsJvm.kt index 4901c0772de..cdc2b228275 100644 --- a/libraries/stdlib/jvm/src/generated/_StringsJvm.kt +++ b/libraries/stdlib/jvm/src/generated/_StringsJvm.kt @@ -31,6 +31,48 @@ public fun CharSequence.toSortedSet(): java.util.SortedSet { return toCollection(java.util.TreeSet()) } +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharSequence.max(): Char? { + return maxOrNull() +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > CharSequence.maxBy(selector: (Char) -> R): Char? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharSequence.maxWith(comparator: Comparator): Char? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharSequence.min(): Char? { + return minOrNull() +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > CharSequence.minBy(selector: (Char) -> R): Char? { + return minByOrNull(selector) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@Suppress("CONFLICTING_OVERLOADS") +public fun CharSequence.minWith(comparator: Comparator): Char? { + return minWithOrNull(comparator) +} + /** * Returns the sum of all values produced by [selector] function applied to each character in the char sequence. */ diff --git a/libraries/stdlib/jvm/src/generated/_UArraysJvm.kt b/libraries/stdlib/jvm/src/generated/_UArraysJvm.kt index 8042390adc1..ce6a70885ec 100644 --- a/libraries/stdlib/jvm/src/generated/_UArraysJvm.kt +++ b/libraries/stdlib/jvm/src/generated/_UArraysJvm.kt @@ -285,6 +285,230 @@ public fun UShortArray.binarySearch(element: UShort, fromIndex: Int = 0, toIndex return -(low + 1) // key not found } +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UIntArray.max(): UInt? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun ULongArray.max(): ULong? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UByteArray.max(): UByte? { + return maxOrNull() +} + +@Deprecated("Use maxOrNull instead.", ReplaceWith("this.maxOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UShortArray.max(): UShort? { + return maxOrNull() +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UIntArray.maxBy(selector: (UInt) -> R): UInt? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ULongArray.maxBy(selector: (ULong) -> R): ULong? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UByteArray.maxBy(selector: (UByte) -> R): UByte? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxByOrNull instead.", ReplaceWith("this.maxByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UShortArray.maxBy(selector: (UShort) -> R): UShort? { + return maxByOrNull(selector) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UIntArray.maxWith(comparator: Comparator): UInt? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun ULongArray.maxWith(comparator: Comparator): ULong? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UByteArray.maxWith(comparator: Comparator): UByte? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use maxWithOrNull instead.", ReplaceWith("this.maxWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UShortArray.maxWith(comparator: Comparator): UShort? { + return maxWithOrNull(comparator) +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UIntArray.min(): UInt? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun ULongArray.min(): ULong? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UByteArray.min(): UByte? { + return minOrNull() +} + +@Deprecated("Use minOrNull instead.", ReplaceWith("this.minOrNull()")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UShortArray.min(): UShort? { + return minOrNull() +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UIntArray.minBy(selector: (UInt) -> R): UInt? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > ULongArray.minBy(selector: (ULong) -> R): ULong? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UByteArray.minBy(selector: (UByte) -> R): UByte? { + return minByOrNull(selector) +} + +@Deprecated("Use minByOrNull instead.", ReplaceWith("this.minByOrNull(selector)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@kotlin.internal.InlineOnly +@Suppress("CONFLICTING_OVERLOADS") +public inline fun > UShortArray.minBy(selector: (UShort) -> R): UShort? { + return minByOrNull(selector) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UIntArray.minWith(comparator: Comparator): UInt? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun ULongArray.minWith(comparator: Comparator): ULong? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UByteArray.minWith(comparator: Comparator): UByte? { + return minWithOrNull(comparator) +} + +@Deprecated("Use minWithOrNull instead.", ReplaceWith("this.minWithOrNull(comparator)")) +@DeprecatedSinceKotlin(warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6") +@SinceKotlin("1.3") +@ExperimentalUnsignedTypes +@Suppress("CONFLICTING_OVERLOADS") +public fun UShortArray.minWith(comparator: Comparator): UShort? { + return minWithOrNull(comparator) +} + /** * Returns the sum of all values produced by [selector] function applied to each element in the array. */ diff --git a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-runtime-merged.txt b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-runtime-merged.txt index a3b3d499c7a..dbce67666b7 100644 --- a/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-runtime-merged.txt +++ b/libraries/tools/binary-compatibility-validator/reference-public-api/kotlin-stdlib-runtime-merged.txt @@ -1406,6 +1406,15 @@ public final class kotlin/collections/ArraysKt { public static final fun maxByOrNull ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun maxByOrNull ([SLkotlin/jvm/functions/Function1;)Ljava/lang/Short; public static final fun maxByOrNull ([ZLkotlin/jvm/functions/Function1;)Ljava/lang/Boolean; + public static final fun maxByOrThrow ([BLkotlin/jvm/functions/Function1;)B + public static final fun maxByOrThrow ([CLkotlin/jvm/functions/Function1;)C + public static final fun maxByOrThrow ([DLkotlin/jvm/functions/Function1;)D + public static final fun maxByOrThrow ([FLkotlin/jvm/functions/Function1;)F + public static final fun maxByOrThrow ([ILkotlin/jvm/functions/Function1;)I + public static final fun maxByOrThrow ([JLkotlin/jvm/functions/Function1;)J + public static final fun maxByOrThrow ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun maxByOrThrow ([SLkotlin/jvm/functions/Function1;)S + public static final fun maxByOrThrow ([ZLkotlin/jvm/functions/Function1;)Z public static final fun maxOrNull ([B)Ljava/lang/Byte; public static final fun maxOrNull ([C)Ljava/lang/Character; public static final fun maxOrNull ([D)Ljava/lang/Double; @@ -1416,6 +1425,16 @@ public final class kotlin/collections/ArraysKt { public static final fun maxOrNull ([Ljava/lang/Double;)Ljava/lang/Double; public static final fun maxOrNull ([Ljava/lang/Float;)Ljava/lang/Float; public static final fun maxOrNull ([S)Ljava/lang/Short; + public static final fun maxOrThrow ([B)B + public static final fun maxOrThrow ([C)C + public static final fun maxOrThrow ([D)D + public static final fun maxOrThrow ([F)F + public static final fun maxOrThrow ([I)I + public static final fun maxOrThrow ([J)J + public static final fun maxOrThrow ([Ljava/lang/Comparable;)Ljava/lang/Comparable; + public static final fun maxOrThrow ([Ljava/lang/Double;)D + public static final fun maxOrThrow ([Ljava/lang/Float;)F + public static final fun maxOrThrow ([S)S public static final synthetic fun maxWith ([BLjava/util/Comparator;)Ljava/lang/Byte; public static final synthetic fun maxWith ([CLjava/util/Comparator;)Ljava/lang/Character; public static final synthetic fun maxWith ([DLjava/util/Comparator;)Ljava/lang/Double; @@ -1434,6 +1453,15 @@ public final class kotlin/collections/ArraysKt { public static final fun maxWithOrNull ([Ljava/lang/Object;Ljava/util/Comparator;)Ljava/lang/Object; public static final fun maxWithOrNull ([SLjava/util/Comparator;)Ljava/lang/Short; public static final fun maxWithOrNull ([ZLjava/util/Comparator;)Ljava/lang/Boolean; + public static final fun maxWithOrThrow ([BLjava/util/Comparator;)B + public static final fun maxWithOrThrow ([CLjava/util/Comparator;)C + public static final fun maxWithOrThrow ([DLjava/util/Comparator;)D + public static final fun maxWithOrThrow ([FLjava/util/Comparator;)F + public static final fun maxWithOrThrow ([ILjava/util/Comparator;)I + public static final fun maxWithOrThrow ([JLjava/util/Comparator;)J + public static final fun maxWithOrThrow ([Ljava/lang/Object;Ljava/util/Comparator;)Ljava/lang/Object; + public static final fun maxWithOrThrow ([SLjava/util/Comparator;)S + public static final fun maxWithOrThrow ([ZLjava/util/Comparator;)Z public static final synthetic fun min ([B)Ljava/lang/Byte; public static final synthetic fun min ([C)Ljava/lang/Character; public static final synthetic fun min ([D)Ljava/lang/Double; @@ -1462,6 +1490,15 @@ public final class kotlin/collections/ArraysKt { public static final fun minByOrNull ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun minByOrNull ([SLkotlin/jvm/functions/Function1;)Ljava/lang/Short; public static final fun minByOrNull ([ZLkotlin/jvm/functions/Function1;)Ljava/lang/Boolean; + public static final fun minByOrThrow ([BLkotlin/jvm/functions/Function1;)B + public static final fun minByOrThrow ([CLkotlin/jvm/functions/Function1;)C + public static final fun minByOrThrow ([DLkotlin/jvm/functions/Function1;)D + public static final fun minByOrThrow ([FLkotlin/jvm/functions/Function1;)F + public static final fun minByOrThrow ([ILkotlin/jvm/functions/Function1;)I + public static final fun minByOrThrow ([JLkotlin/jvm/functions/Function1;)J + public static final fun minByOrThrow ([Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun minByOrThrow ([SLkotlin/jvm/functions/Function1;)S + public static final fun minByOrThrow ([ZLkotlin/jvm/functions/Function1;)Z public static final fun minOrNull ([B)Ljava/lang/Byte; public static final fun minOrNull ([C)Ljava/lang/Character; public static final fun minOrNull ([D)Ljava/lang/Double; @@ -1472,6 +1509,16 @@ public final class kotlin/collections/ArraysKt { public static final fun minOrNull ([Ljava/lang/Double;)Ljava/lang/Double; public static final fun minOrNull ([Ljava/lang/Float;)Ljava/lang/Float; public static final fun minOrNull ([S)Ljava/lang/Short; + public static final fun minOrThrow ([B)B + public static final fun minOrThrow ([C)C + public static final fun minOrThrow ([D)D + public static final fun minOrThrow ([F)F + public static final fun minOrThrow ([I)I + public static final fun minOrThrow ([J)J + public static final fun minOrThrow ([Ljava/lang/Comparable;)Ljava/lang/Comparable; + public static final fun minOrThrow ([Ljava/lang/Double;)D + public static final fun minOrThrow ([Ljava/lang/Float;)F + public static final fun minOrThrow ([S)S public static final synthetic fun minWith ([BLjava/util/Comparator;)Ljava/lang/Byte; public static final synthetic fun minWith ([CLjava/util/Comparator;)Ljava/lang/Character; public static final synthetic fun minWith ([DLjava/util/Comparator;)Ljava/lang/Double; @@ -1490,6 +1537,15 @@ public final class kotlin/collections/ArraysKt { public static final fun minWithOrNull ([Ljava/lang/Object;Ljava/util/Comparator;)Ljava/lang/Object; public static final fun minWithOrNull ([SLjava/util/Comparator;)Ljava/lang/Short; public static final fun minWithOrNull ([ZLjava/util/Comparator;)Ljava/lang/Boolean; + public static final fun minWithOrThrow ([BLjava/util/Comparator;)B + public static final fun minWithOrThrow ([CLjava/util/Comparator;)C + public static final fun minWithOrThrow ([DLjava/util/Comparator;)D + public static final fun minWithOrThrow ([FLjava/util/Comparator;)F + public static final fun minWithOrThrow ([ILjava/util/Comparator;)I + public static final fun minWithOrThrow ([JLjava/util/Comparator;)J + public static final fun minWithOrThrow ([Ljava/lang/Object;Ljava/util/Comparator;)Ljava/lang/Object; + public static final fun minWithOrThrow ([SLjava/util/Comparator;)S + public static final fun minWithOrThrow ([ZLjava/util/Comparator;)Z public static final fun none ([B)Z public static final fun none ([BLkotlin/jvm/functions/Function1;)Z public static final fun none ([C)Z @@ -2254,21 +2310,31 @@ public final class kotlin/collections/CollectionsKt { public static final synthetic fun max (Ljava/lang/Iterable;)Ljava/lang/Float; public static final synthetic fun maxBy (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun maxByOrNull (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun maxByOrThrow (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun maxOrNull (Ljava/lang/Iterable;)Ljava/lang/Comparable; public static final fun maxOrNull (Ljava/lang/Iterable;)Ljava/lang/Double; public static final fun maxOrNull (Ljava/lang/Iterable;)Ljava/lang/Float; + public static final fun maxOrThrow (Ljava/lang/Iterable;)D + public static final fun maxOrThrow (Ljava/lang/Iterable;)F + public static final fun maxOrThrow (Ljava/lang/Iterable;)Ljava/lang/Comparable; public static final synthetic fun maxWith (Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/lang/Object; public static final fun maxWithOrNull (Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/lang/Object; + public static final fun maxWithOrThrow (Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/lang/Object; public static final synthetic fun min (Ljava/lang/Iterable;)Ljava/lang/Comparable; public static final synthetic fun min (Ljava/lang/Iterable;)Ljava/lang/Double; public static final synthetic fun min (Ljava/lang/Iterable;)Ljava/lang/Float; public static final synthetic fun minBy (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun minByOrNull (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun minByOrThrow (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun minOrNull (Ljava/lang/Iterable;)Ljava/lang/Comparable; public static final fun minOrNull (Ljava/lang/Iterable;)Ljava/lang/Double; public static final fun minOrNull (Ljava/lang/Iterable;)Ljava/lang/Float; + public static final fun minOrThrow (Ljava/lang/Iterable;)D + public static final fun minOrThrow (Ljava/lang/Iterable;)F + public static final fun minOrThrow (Ljava/lang/Iterable;)Ljava/lang/Comparable; public static final synthetic fun minWith (Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/lang/Object; public static final fun minWithOrNull (Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/lang/Object; + public static final fun minWithOrThrow (Ljava/lang/Iterable;Ljava/util/Comparator;)Ljava/lang/Object; public static final fun minus (Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List; public static final fun minus (Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/util/List; public static final fun minus (Ljava/lang/Iterable;Lkotlin/sequences/Sequence;)Ljava/util/List; @@ -2685,6 +2751,10 @@ public final class kotlin/collections/unsigned/UArraysKt { public static final fun maxOrNull-GBYM_sE ([B)Lkotlin/UByte; public static final fun maxOrNull-QwZRm1k ([J)Lkotlin/ULong; public static final fun maxOrNull-rL5Bavg ([S)Lkotlin/UShort; + public static final fun maxOrThrow-U ([B)B + public static final fun maxOrThrow-U ([I)I + public static final fun maxOrThrow-U ([J)J + public static final fun maxOrThrow-U ([S)S public static final synthetic fun maxWith-XMRcp5o ([BLjava/util/Comparator;)Lkotlin/UByte; public static final synthetic fun maxWith-YmdZ_VM ([ILjava/util/Comparator;)Lkotlin/UInt; public static final synthetic fun maxWith-eOHTfZs ([SLjava/util/Comparator;)Lkotlin/UShort; @@ -2693,6 +2763,10 @@ public final class kotlin/collections/unsigned/UArraysKt { public static final fun maxWithOrNull-YmdZ_VM ([ILjava/util/Comparator;)Lkotlin/UInt; public static final fun maxWithOrNull-eOHTfZs ([SLjava/util/Comparator;)Lkotlin/UShort; public static final fun maxWithOrNull-zrEWJaI ([JLjava/util/Comparator;)Lkotlin/ULong; + public static final fun maxWithOrThrow-U ([BLjava/util/Comparator;)B + public static final fun maxWithOrThrow-U ([ILjava/util/Comparator;)I + public static final fun maxWithOrThrow-U ([JLjava/util/Comparator;)J + public static final fun maxWithOrThrow-U ([SLjava/util/Comparator;)S public static final synthetic fun min--ajY-9A ([I)Lkotlin/UInt; public static final synthetic fun min-GBYM_sE ([B)Lkotlin/UByte; public static final synthetic fun min-QwZRm1k ([J)Lkotlin/ULong; @@ -2701,6 +2775,10 @@ public final class kotlin/collections/unsigned/UArraysKt { public static final fun minOrNull-GBYM_sE ([B)Lkotlin/UByte; public static final fun minOrNull-QwZRm1k ([J)Lkotlin/ULong; public static final fun minOrNull-rL5Bavg ([S)Lkotlin/UShort; + public static final fun minOrThrow-U ([B)B + public static final fun minOrThrow-U ([I)I + public static final fun minOrThrow-U ([J)J + public static final fun minOrThrow-U ([S)S public static final synthetic fun minWith-XMRcp5o ([BLjava/util/Comparator;)Lkotlin/UByte; public static final synthetic fun minWith-YmdZ_VM ([ILjava/util/Comparator;)Lkotlin/UInt; public static final synthetic fun minWith-eOHTfZs ([SLjava/util/Comparator;)Lkotlin/UShort; @@ -2709,6 +2787,10 @@ public final class kotlin/collections/unsigned/UArraysKt { public static final fun minWithOrNull-YmdZ_VM ([ILjava/util/Comparator;)Lkotlin/UInt; public static final fun minWithOrNull-eOHTfZs ([SLjava/util/Comparator;)Lkotlin/UShort; public static final fun minWithOrNull-zrEWJaI ([JLjava/util/Comparator;)Lkotlin/ULong; + public static final fun minWithOrThrow-U ([BLjava/util/Comparator;)B + public static final fun minWithOrThrow-U ([ILjava/util/Comparator;)I + public static final fun minWithOrThrow-U ([JLjava/util/Comparator;)J + public static final fun minWithOrThrow-U ([SLjava/util/Comparator;)S public static final fun plus-CFIt9YE ([ILjava/util/Collection;)[I public static final fun plus-kzHmqpY ([JLjava/util/Collection;)[J public static final fun plus-ojwP5H8 ([SLjava/util/Collection;)[S @@ -4989,21 +5071,31 @@ public final class kotlin/sequences/SequencesKt { public static final synthetic fun max (Lkotlin/sequences/Sequence;)Ljava/lang/Float; public static final synthetic fun maxBy (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun maxByOrNull (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun maxByOrThrow (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun maxOrNull (Lkotlin/sequences/Sequence;)Ljava/lang/Comparable; public static final fun maxOrNull (Lkotlin/sequences/Sequence;)Ljava/lang/Double; public static final fun maxOrNull (Lkotlin/sequences/Sequence;)Ljava/lang/Float; + public static final fun maxOrThrow (Lkotlin/sequences/Sequence;)D + public static final fun maxOrThrow (Lkotlin/sequences/Sequence;)F + public static final fun maxOrThrow (Lkotlin/sequences/Sequence;)Ljava/lang/Comparable; public static final synthetic fun maxWith (Lkotlin/sequences/Sequence;Ljava/util/Comparator;)Ljava/lang/Object; public static final fun maxWithOrNull (Lkotlin/sequences/Sequence;Ljava/util/Comparator;)Ljava/lang/Object; + public static final fun maxWithOrThrow (Lkotlin/sequences/Sequence;Ljava/util/Comparator;)Ljava/lang/Object; public static final synthetic fun min (Lkotlin/sequences/Sequence;)Ljava/lang/Comparable; public static final synthetic fun min (Lkotlin/sequences/Sequence;)Ljava/lang/Double; public static final synthetic fun min (Lkotlin/sequences/Sequence;)Ljava/lang/Float; public static final synthetic fun minBy (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun minByOrNull (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; + public static final fun minByOrThrow (Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object; public static final fun minOrNull (Lkotlin/sequences/Sequence;)Ljava/lang/Comparable; public static final fun minOrNull (Lkotlin/sequences/Sequence;)Ljava/lang/Double; public static final fun minOrNull (Lkotlin/sequences/Sequence;)Ljava/lang/Float; + public static final fun minOrThrow (Lkotlin/sequences/Sequence;)D + public static final fun minOrThrow (Lkotlin/sequences/Sequence;)F + public static final fun minOrThrow (Lkotlin/sequences/Sequence;)Ljava/lang/Comparable; public static final synthetic fun minWith (Lkotlin/sequences/Sequence;Ljava/util/Comparator;)Ljava/lang/Object; public static final fun minWithOrNull (Lkotlin/sequences/Sequence;Ljava/util/Comparator;)Ljava/lang/Object; + public static final fun minWithOrThrow (Lkotlin/sequences/Sequence;Ljava/util/Comparator;)Ljava/lang/Object; public static final fun minus (Lkotlin/sequences/Sequence;Ljava/lang/Iterable;)Lkotlin/sequences/Sequence; public static final fun minus (Lkotlin/sequences/Sequence;Ljava/lang/Object;)Lkotlin/sequences/Sequence; public static final fun minus (Lkotlin/sequences/Sequence;Lkotlin/sequences/Sequence;)Lkotlin/sequences/Sequence; @@ -5416,15 +5508,21 @@ public final class kotlin/text/StringsKt { public static final synthetic fun max (Ljava/lang/CharSequence;)Ljava/lang/Character; public static final synthetic fun maxBy (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Character; public static final fun maxByOrNull (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Character; + public static final fun maxByOrThrow (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)C public static final fun maxOrNull (Ljava/lang/CharSequence;)Ljava/lang/Character; + public static final fun maxOrThrow (Ljava/lang/CharSequence;)C public static final synthetic fun maxWith (Ljava/lang/CharSequence;Ljava/util/Comparator;)Ljava/lang/Character; public static final fun maxWithOrNull (Ljava/lang/CharSequence;Ljava/util/Comparator;)Ljava/lang/Character; + public static final fun maxWithOrThrow (Ljava/lang/CharSequence;Ljava/util/Comparator;)C public static final synthetic fun min (Ljava/lang/CharSequence;)Ljava/lang/Character; public static final synthetic fun minBy (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Character; public static final fun minByOrNull (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/Character; + public static final fun minByOrThrow (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)C public static final fun minOrNull (Ljava/lang/CharSequence;)Ljava/lang/Character; + public static final fun minOrThrow (Ljava/lang/CharSequence;)C public static final synthetic fun minWith (Ljava/lang/CharSequence;Ljava/util/Comparator;)Ljava/lang/Character; public static final fun minWithOrNull (Ljava/lang/CharSequence;Ljava/util/Comparator;)Ljava/lang/Character; + public static final fun minWithOrThrow (Ljava/lang/CharSequence;Ljava/util/Comparator;)C public static final fun none (Ljava/lang/CharSequence;)Z public static final fun none (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Z public static final fun onEach (Ljava/lang/CharSequence;Lkotlin/jvm/functions/Function1;)Ljava/lang/CharSequence; diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Aggregates.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Aggregates.kt index cdd742c5ec5..3155ca6b677 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Aggregates.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Aggregates.kt @@ -315,8 +315,9 @@ object Aggregates : TemplateGroupBase() { val f_minMax = sequence { val genericSpecializations = PrimitiveType.floatingPointPrimitives + setOf(null) - fun def(op: String, nullable: Boolean, orNull: String = "OrNull".ifOrEmpty(nullable)) = + fun def(op: String, nullable: Boolean, legacy: Boolean = false, orNull: String = "OrNull".ifOrEmpty(nullable)) = fn("$op$orNull()") { + if (legacy) platforms(Platform.JVM) include(Iterables, genericSpecializations) include(Sequences, genericSpecializations) include(ArraysOfObjects, genericSpecializations) @@ -325,13 +326,14 @@ object Aggregates : TemplateGroupBase() { include(CharSequences) } builder { typeParam("T : Comparable") - returns("T?") + returns("T" + "?".ifOrEmpty(nullable)) val isFloat = primitive?.isFloatingPoint() == true + val isUnsigned = family == ArraysOfUnsigned - if (!nullable) { + if (!nullable || legacy) suppress("CONFLICTING_OVERLOADS") + if (legacy) { deprecate(Deprecation("Use ${op}OrNull instead.", "this.${op}OrNull()", warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")) - val isGeneric = f in listOf(Iterables, Sequences, ArraysOfObjects) if (isFloat && isGeneric) { since("1.1") @@ -342,12 +344,19 @@ object Aggregates : TemplateGroupBase() { return@builder } + val doOnEmpty = if (nullable) "return null" else "throw NoSuchElementException()" + since("1.4") + if (!nullable) since("1.7") doc { - "Returns the ${if (op == "max") "largest" else "smallest"} ${f.element} or `null` if there are no ${f.element.pluralize()}." + + "Returns the ${if (op == "max") "largest" else "smallest"} ${f.element}${" or `null` if there are no ${f.element.pluralize()}".ifOrEmpty(nullable)}." + if (isFloat) "\n\n" + "If any of ${f.element.pluralize()} is `NaN` returns `NaN`." else "" } + if (!nullable) { + throws("NoSuchElementException", "if the ${f.collection} is empty.") + annotation("@kotlin.jvm.JvmName(\"${op}OrThrow${"-U".ifOrEmpty(isUnsigned)}\")") + } val acc = op val cmpBlock = if (isFloat) @@ -357,7 +366,7 @@ object Aggregates : TemplateGroupBase() { body { """ val iterator = iterator() - if (!iterator.hasNext()) return null + if (!iterator.hasNext()) $doOnEmpty var $acc = iterator.next() while (iterator.hasNext()) { val e = iterator.next() @@ -368,7 +377,7 @@ object Aggregates : TemplateGroupBase() { } body(ArraysOfObjects, ArraysOfPrimitives, CharSequences, ArraysOfUnsigned) { """ - if (isEmpty()) return null + if (isEmpty()) $doOnEmpty var $acc = this[0] for (i in 1..lastIndex) { val e = this[i] @@ -379,39 +388,52 @@ object Aggregates : TemplateGroupBase() { } } - for (op in listOf("min", "max")) + for (op in listOf("min", "max")) { for (nullable in listOf(false, true)) yield(def(op, nullable)) + yield(def(op, nullable = true, legacy = true, orNull = "")) + } } val f_minMaxBy = sequence { - fun def(op: String, nullable: Boolean, orNull: String = "OrNull".ifOrEmpty(nullable)) = + fun def(op: String, nullable: Boolean, legacy: Boolean = false, orNull: String = "OrNull".ifOrEmpty(nullable)) = fn("$op$orNull(selector: (T) -> R)") { + if (legacy) platforms(Platform.JVM) includeDefault() include(Maps, CharSequences, ArraysOfUnsigned) } builder { inline() specialFor(ArraysOfUnsigned) { inlineOnly() } - specialFor(Maps) { if (op == "maxBy" || nullable) inlineOnly() } + specialFor(Maps) { if (op == "maxBy" || !legacy) inlineOnly() } typeParam("R : Comparable") - returns("T?") + returns("T" + "?".ifOrEmpty(nullable)) + val isUnsigned = family == ArraysOfUnsigned - if (!nullable) { + if (!nullable || legacy) suppress("CONFLICTING_OVERLOADS") + if (legacy) { deprecate(Deprecation("Use ${op}OrNull instead.", "this.${op}OrNull(selector)", warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")) body { "return ${op}OrNull(selector)" } return@builder } - since("1.4") + val doOnEmpty = if (nullable) "return null" else "throw NoSuchElementException()" - doc { "Returns the first ${f.element} yielding the ${if (op == "maxBy") "largest" else "smallest"} value of the given function or `null` if there are no ${f.element.pluralize()}." } + since("1.4") + if (!nullable) since("1.7") + + doc { "Returns the first ${f.element} yielding the ${if (op == "maxBy") "largest" else "smallest"} value of the given function${" or `null` if there are no ${f.element.pluralize()}".ifOrEmpty(nullable)}." } sample("samples.collections.Collections.Aggregates.$op$orNull") + if (!nullable) { + throws("NoSuchElementException", "if the ${f.collection} is empty.") + annotation("@kotlin.jvm.JvmName(\"${op}OrThrow${"-U".ifOrEmpty(isUnsigned)}\")") + } + val (elem, value, cmp) = if (op == "minBy") Triple("minElem", "minValue", ">") else Triple("maxElem", "maxValue", "<") body { """ val iterator = iterator() - if (!iterator.hasNext()) return null + if (!iterator.hasNext()) $doOnEmpty var $elem = iterator.next() if (!iterator.hasNext()) return $elem @@ -429,7 +451,7 @@ object Aggregates : TemplateGroupBase() { } body(CharSequences, ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned) { """ - if (isEmpty()) return null + if (isEmpty()) $doOnEmpty var $elem = this[0] val lastIndex = this.lastIndex @@ -449,35 +471,47 @@ object Aggregates : TemplateGroupBase() { body(Maps) { "return entries.$op$orNull(selector)" } } - for (op in listOf("minBy", "maxBy")) + for (op in listOf("minBy", "maxBy")) { for (nullable in listOf(false, true)) yield(def(op, nullable)) + yield(def(op, nullable = true, legacy = true, orNull = "")) + } } val f_minMaxWith = sequence { - fun def(op: String, nullable: Boolean, orNull: String = "OrNull".ifOrEmpty(nullable)) = + fun def(op: String, nullable: Boolean, legacy: Boolean = false, orNull: String = "OrNull".ifOrEmpty(nullable)) = fn("$op$orNull(comparator: Comparator)") { + if (legacy) platforms(Platform.JVM) includeDefault() include(Maps, CharSequences, ArraysOfUnsigned) } builder { - specialFor(Maps) { if (op == "maxWith" || nullable) inlineOnly() } - returns("T?") + specialFor(Maps) { if (op == "maxWith" || !legacy) inlineOnly() } + returns("T" + "?".ifOrEmpty(nullable)) + val isUnsigned = family == ArraysOfUnsigned - if (!nullable) { + if (!nullable || legacy) suppress("CONFLICTING_OVERLOADS") + if (legacy) { deprecate(Deprecation("Use ${op}OrNull instead.", "this.${op}OrNull(comparator)", warningSince = "1.4", errorSince = "1.5", hiddenSince = "1.6")) body { "return ${op}OrNull(comparator)" } return@builder } - since("1.4") + val doOnEmpty = if (nullable) "return null" else "throw NoSuchElementException()" - doc { "Returns the first ${f.element} having the ${if (op == "maxWith") "largest" else "smallest"} value according to the provided [comparator] or `null` if there are no ${f.element.pluralize()}." } + since("1.4") + if (!nullable) since("1.7") + + doc { "Returns the first ${f.element} having the ${if (op == "maxWith") "largest" else "smallest"} value according to the provided [comparator]${" or `null` if there are no ${f.element.pluralize()}".ifOrEmpty(nullable)}." } + if (!nullable) { + throws("NoSuchElementException", "if the ${f.collection} is empty.") + annotation("@kotlin.jvm.JvmName(\"${op}OrThrow${"-U".ifOrEmpty(isUnsigned)}\")") + } val (acc, cmp) = if (op == "minWith") Pair("min", ">") else Pair("max", "<") body { """ val iterator = iterator() - if (!iterator.hasNext()) return null + if (!iterator.hasNext()) $doOnEmpty var $acc = iterator.next() while (iterator.hasNext()) { @@ -489,7 +523,7 @@ object Aggregates : TemplateGroupBase() { } body(CharSequences, ArraysOfObjects, ArraysOfPrimitives, ArraysOfUnsigned) { """ - if (isEmpty()) return null + if (isEmpty()) $doOnEmpty var $acc = this[0] for (i in 1..lastIndex) { val e = this[i] @@ -501,9 +535,11 @@ object Aggregates : TemplateGroupBase() { body(Maps) { "return entries.$op$orNull(comparator)" } } - for (op in listOf("minWith", "maxWith")) + for (op in listOf("minWith", "maxWith")) { for (nullable in listOf(false, true)) yield(def(op, nullable)) + yield(def(op, nullable = true, legacy = true, orNull = "")) + } } fun f_minMaxOf() = sequence { @@ -526,10 +562,10 @@ object Aggregates : TemplateGroupBase() { """ + """ If any of values produced by [selector] function is `NaN`, the returned result is `NaN`. - """.ifOrEmpty(isFloat) + - """ - @throws NoSuchElementException if the ${f.collection} is empty. - """.ifOrEmpty(!nullable) + """.ifOrEmpty(isFloat) + } + if (!nullable) { + throws("NoSuchElementException", "if the ${f.collection} is empty.") } if (!isFloat) typeParam("R : Comparable")