From 27904c0fb9c53a334765cfbd195288a84a5d8a97 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Fri, 5 Mar 2021 11:44:32 +0300 Subject: [PATCH] Native compiler source: replace inline classes by value classes The former are deprecated. --- .../Runtime/src/main/kotlin/kotlinx/cinterop/StableRef.kt | 3 ++- .../kotlin/backend/konan/descriptors/DescriptorUtils.kt | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kotlin-native/Interop/Runtime/src/main/kotlin/kotlinx/cinterop/StableRef.kt b/kotlin-native/Interop/Runtime/src/main/kotlin/kotlinx/cinterop/StableRef.kt index 060aa818c66..727dbe9f469 100644 --- a/kotlin-native/Interop/Runtime/src/main/kotlin/kotlinx/cinterop/StableRef.kt +++ b/kotlin-native/Interop/Runtime/src/main/kotlin/kotlinx/cinterop/StableRef.kt @@ -27,7 +27,8 @@ typealias StableObjPtr = StableRef<*> * Any [StableRef] should be manually [disposed][dispose] */ @Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS") -public inline class StableRef @PublishedApi internal constructor( +@kotlin.jvm.JvmInline +public value class StableRef @PublishedApi internal constructor( private val stablePtr: COpaquePointer ) { diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt index 3b5f13a5cb7..e945ff8d847 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/descriptors/DescriptorUtils.kt @@ -105,8 +105,8 @@ private fun IrFunction.typeWithKindAt(index: ParameterIndex) = when (index) { private fun IrFunction.needBridgeToAt(target: IrFunction, index: ParameterIndex) = bridgeDirectionToAt(target, index).kind != BridgeDirectionKind.NONE -@Suppress("EXPERIMENTAL_FEATURE_WARNING") -private inline class ParameterIndex(val index: Int) { +@JvmInline +private value class ParameterIndex(val index: Int) { companion object { val RETURN_INDEX = ParameterIndex(0) val DISPATCH_RECEIVER_INDEX = ParameterIndex(1)