From 12eb6d97bf3d58b97c72d91d49963e8a2db0dc04 Mon Sep 17 00:00:00 2001 From: Roman Efremov Date: Fri, 30 Jun 2023 12:45:14 +0200 Subject: [PATCH] [Stdlib] Remove @InlineOnly from expect declarations of minOf(), maxOf() to satisfy MPP annotation checker. It has reporting because @InlineOnly is absent on declarations with Long parameter (removed in 233376eef00baf119ee1099645a0949f92cefec7). ^KT-58551 --- .../stdlib/common/src/generated/_Comparisons.kt | 12 ------------ .../kotlin-stdlib-gen/src/templates/Comparables.kt | 6 ++++++ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/libraries/stdlib/common/src/generated/_Comparisons.kt b/libraries/stdlib/common/src/generated/_Comparisons.kt index de4a518b3ac..b65cab1d9d4 100644 --- a/libraries/stdlib/common/src/generated/_Comparisons.kt +++ b/libraries/stdlib/common/src/generated/_Comparisons.kt @@ -27,28 +27,24 @@ public expect fun > maxOf(a: T, b: T): T * Returns the greater of two values. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun maxOf(a: Byte, b: Byte): Byte /** * Returns the greater of two values. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun maxOf(a: Short, b: Short): Short /** * Returns the greater of two values. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun maxOf(a: Int, b: Int): Int /** * Returns the greater of two values. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun maxOf(a: Long, b: Long): Long /** @@ -57,7 +53,6 @@ public expect inline fun maxOf(a: Long, b: Long): Long * If either value is `NaN`, returns `NaN`. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun maxOf(a: Float, b: Float): Float /** @@ -66,7 +61,6 @@ public expect inline fun maxOf(a: Float, b: Float): Float * If either value is `NaN`, returns `NaN`. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun maxOf(a: Double, b: Double): Double /** @@ -215,28 +209,24 @@ public expect fun > minOf(a: T, b: T): T * Returns the smaller of two values. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun minOf(a: Byte, b: Byte): Byte /** * Returns the smaller of two values. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun minOf(a: Short, b: Short): Short /** * Returns the smaller of two values. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun minOf(a: Int, b: Int): Int /** * Returns the smaller of two values. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun minOf(a: Long, b: Long): Long /** @@ -245,7 +235,6 @@ public expect inline fun minOf(a: Long, b: Long): Long * If either value is `NaN`, returns `NaN`. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun minOf(a: Float, b: Float): Float /** @@ -254,7 +243,6 @@ public expect inline fun minOf(a: Float, b: Float): Float * If either value is `NaN`, returns `NaN`. */ @SinceKotlin("1.1") -@kotlin.internal.InlineOnly public expect inline fun minOf(a: Double, b: Double): Double /** diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Comparables.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Comparables.kt index 1bed1804f1f..ba019b17a77 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Comparables.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Comparables.kt @@ -180,6 +180,9 @@ object ComparableOps : TemplateGroupBase() { body { "return $defaultImpl" } specialFor(Primitives) { inlineOnly() + on(Platform.Common) { + inline() + } var convertBack = "to$primitive()" on(Platform.JS) { convertBack = "unsafeCast<$primitive>()" @@ -381,6 +384,9 @@ object ComparableOps : TemplateGroupBase() { body { "return $defaultImpl" } specialFor(Primitives) { inlineOnly() + on(Platform.Common) { + inline() + } var convertBack = "to$primitive()" on(Platform.JS) { convertBack = "unsafeCast<$primitive>()"