diff --git a/.gitignore b/.gitignore index caac4238..9d1879fd 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ build !.idea/codeStyles/* !.idea/icon.svg !.idea/detekt.xml +!.idea/kotlinTestDataPluginTestDataPaths.xml .DS_Store diff --git a/.idea/kotlinTestDataPluginTestDataPaths.xml b/.idea/kotlinTestDataPluginTestDataPaths.xml new file mode 100644 index 00000000..3d2ddced --- /dev/null +++ b/.idea/kotlinTestDataPluginTestDataPaths.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index c8873ab0..3c690453 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -30,8 +30,7 @@ apiValidation { ignoredProjects.addAll( listOf( - "codegen-tests-jvm", - "codegen-tests-mpp", + "compiler-plugin-tests", "krpc-test", "utils", ) diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/RPCIrPlugin.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/RPCIrPlugin.kt deleted file mode 100644 index 3ad1c0d8..00000000 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/RPCIrPlugin.kt +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.codegen - -import kotlinx.rpc.codegen.extension.RPCIrExtension -import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension -import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys -import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.config.CompilerConfiguration - -object RPCIrPlugin { - fun provideExtension(configuration: CompilerConfiguration): IrGenerationExtension { - val logger = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE) - val versionSpecificApi = VersionSpecificApi.INSTANCE - - return RPCIrExtension(logger, versionSpecificApi) - } -} diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RPCIrExtension.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RPCIrExtension.kt index a2235cf6..6a45a044 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RPCIrExtension.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RPCIrExtension.kt @@ -7,18 +7,19 @@ package kotlinx.rpc.codegen.extension import kotlinx.rpc.codegen.VersionSpecificApi import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext +import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys import org.jetbrains.kotlin.cli.common.messages.MessageCollector +import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.ir.declarations.IrModuleFragment -internal class RPCIrExtension( - private val logger: MessageCollector, - private val versionSpecificApi: VersionSpecificApi, -) : IrGenerationExtension { +class RPCIrExtension(configuration: CompilerConfiguration) : IrGenerationExtension { + private val logger = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE) + override fun generate( moduleFragment: IrModuleFragment, pluginContext: IrPluginContext, ) { - val context = RPCIrContext(pluginContext, versionSpecificApi) + val context = RPCIrContext(pluginContext, VersionSpecificApi.INSTANCE) val processor = RPCIrServiceProcessor(logger) moduleFragment.transform(processor, context) diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RPCStubGenerator.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RPCStubGenerator.kt index ac7c80dc..4e34f798 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RPCStubGenerator.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RPCStubGenerator.kt @@ -5,6 +5,7 @@ package kotlinx.rpc.codegen.extension import kotlinx.rpc.codegen.VersionSpecificApi +import kotlinx.rpc.codegen.VersionSpecificApiImpl.copyToVS import kotlinx.rpc.codegen.common.rpcMethodClassName import kotlinx.rpc.codegen.common.rpcMethodClassNameKsp import org.jetbrains.kotlin.backend.common.lower.DeclarationIrBuilder @@ -1274,7 +1275,7 @@ internal class RPCStubGenerator( it.name == OperatorNameConventions.EQUALS }.symbol - dispatchReceiverParameter = anyClass.thisReceiver + dispatchReceiverParameter = anyClass.copyThisReceiver(this@apply) addValueParameter { name = Name.identifier("other") @@ -1295,7 +1296,7 @@ internal class RPCStubGenerator( it.name == OperatorNameConventions.HASH_CODE }.symbol - dispatchReceiverParameter = anyClass.thisReceiver + dispatchReceiverParameter = anyClass.copyThisReceiver(this@apply) } addFunction { @@ -1311,10 +1312,13 @@ internal class RPCStubGenerator( it.name == OperatorNameConventions.TO_STRING }.symbol - dispatchReceiverParameter = anyClass.thisReceiver + dispatchReceiverParameter = anyClass.copyThisReceiver(this@apply) } } + private fun IrClass.copyThisReceiver(function: IrFunction) = + thisReceiver?.copyToVS(function, origin = IrDeclarationOrigin.DEFINED) + private fun stringConst(value: String) = IrConstImpl.string( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, diff --git a/compiler-plugin/compiler-plugin-cli/src/main/latest/kotlinx/rpc/codegen/RPCCompilerPlugin.kt b/compiler-plugin/compiler-plugin-cli/src/main/latest/kotlinx/rpc/codegen/RPCCompilerPlugin.kt index 63ac652b..5f725c7e 100644 --- a/compiler-plugin/compiler-plugin-cli/src/main/latest/kotlinx/rpc/codegen/RPCCompilerPlugin.kt +++ b/compiler-plugin/compiler-plugin-cli/src/main/latest/kotlinx/rpc/codegen/RPCCompilerPlugin.kt @@ -4,6 +4,7 @@ package kotlinx.rpc.codegen +import kotlinx.rpc.codegen.extension.RPCIrExtension import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension import org.jetbrains.kotlin.compiler.plugin.CliOption import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor @@ -21,16 +22,17 @@ class RPCCommandLineProcessor : CommandLineProcessor { @OptIn(ExperimentalCompilerApi::class) class RPCCompilerPlugin : CompilerPluginRegistrar() { - init { - VersionSpecificApi.INSTANCE = VersionSpecificApiImpl - } - override val supportsK2: Boolean = true override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) { - val irExtension = RPCIrPlugin.provideExtension(configuration) - - IrGenerationExtension.registerExtension(irExtension) - FirExtensionRegistrarAdapter.registerExtension(FirRPCExtensionRegistrar(configuration)) + registerRpcExtensions(configuration) } } + +@OptIn(ExperimentalCompilerApi::class) +fun CompilerPluginRegistrar.ExtensionStorage.registerRpcExtensions(configuration: CompilerConfiguration) { + VersionSpecificApi.INSTANCE = VersionSpecificApiImpl + + IrGenerationExtension.registerExtension(RPCIrExtension(configuration)) + FirExtensionRegistrarAdapter.registerExtension(FirRPCExtensionRegistrar(configuration)) +} diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/UninitializedRPCFieldException.kt b/core/src/commonMain/kotlin/kotlinx/rpc/UninitializedRPCFieldException.kt new file mode 100644 index 00000000..49db36cf --- /dev/null +++ b/core/src/commonMain/kotlin/kotlinx/rpc/UninitializedRPCFieldException.kt @@ -0,0 +1,16 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc + +import kotlin.reflect.KProperty + +/** + * Thrown when an uninitialized field of an RPC interface is accessed. + * + * Use [awaitFieldInitialization] to await for the field initialization + */ +public class UninitializedRPCFieldException(serviceName: String, property: KProperty<*>): Exception() { + override val message: String = "${property.name} field of RPC service \"$serviceName\" in not initialized" +} diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/awaitFieldInitialization.kt b/core/src/commonMain/kotlin/kotlinx/rpc/awaitFieldInitialization.kt new file mode 100644 index 00000000..4ad34b8d --- /dev/null +++ b/core/src/commonMain/kotlin/kotlinx/rpc/awaitFieldInitialization.kt @@ -0,0 +1,88 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc + +import kotlinx.rpc.internal.RPCDeferredField +import kotlinx.rpc.internal.RPCServiceFieldsProvider +import kotlinx.rpc.internal.findRPCStubProvider +import kotlinx.rpc.internal.safeCast +import kotlin.reflect.KClass + +/** + * Waits for the initialization of an RPC field in the generated client: + * + * ```kotlin + * interface MyService : RPC { + * val stateFlow: StateFlow + * } + * + * val service = rpcClient.withService() + * val currentValue = service.awaitFieldInitialization { stateFlow }.value + * ``` + * + * @param T service type + * @param R field type + * @param getter function that returns the field of the context service to wait for. + * @return service filed after it was initialized. + */ +public suspend fun T.awaitFieldInitialization(getter: T.() -> R): R { + val field = getter() + + if (field is RPCDeferredField<*>) { + @Suppress("UNCHECKED_CAST") + return (field as RPCDeferredField).await() + } + + error("Please choose required field for a valid RPC client generated by RPCClient.withService method") +} + +/** + * Waits for the initialization of all RPC fields in the generated client: + * + * ```kotlin + * interface MyService : RPC { + * val stateFlow1: StateFlow + * val stateFlow2: StateFlow + * } + * + * val service = rpcClient.withService() + * val currentValue = service.awaitFieldInitialization() + * // fields `stateFlow1` and `stateFlow2` are initialized + * ``` + * + * @param T service type + * @return specified service, after all of it's field were initialized. + */ +public suspend inline fun T.awaitFieldInitialization(): T { + return awaitFieldInitialization(T::class) +} + +/** + * Waits for the initialization of all RPC fields in the generated client: + * + * ```kotlin + * interface MyService : RPC { + * val stateFlow1: StateFlow + * val stateFlow2: StateFlow + * } + * + * val service = rpcClient.withService() + * val currentValue = service.awaitFieldInitialization(MyService::class) + * // fields `stateFlow1` and `stateFlow2` are initialized + * ``` + * + * @param T service type + * @param kClass [KClass] of the [T] type. + * @return specified service, after all of it's field were initialized. + */ +public suspend fun T.awaitFieldInitialization(kClass: KClass): T { + findRPCStubProvider>(kClass, RPCServiceFieldsProvider::class.safeCast()) + .rpcFields(this) + .forEach { field -> + field.await() + } + + return this +} diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/withService.kt b/core/src/commonMain/kotlin/kotlinx/rpc/withService.kt new file mode 100644 index 00000000..3b5180b9 --- /dev/null +++ b/core/src/commonMain/kotlin/kotlinx/rpc/withService.kt @@ -0,0 +1,64 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc + +import kotlinx.atomicfu.atomic +import kotlinx.rpc.internal.RPCStubServiceProvider +import kotlinx.rpc.internal.findRPCStubProvider +import kotlinx.rpc.internal.kClass +import kotlinx.rpc.internal.safeCast +import kotlin.reflect.KClass +import kotlin.reflect.KType + +/** + * Creates instance of the generated service [T], that is able to communicate with server using RPCClient. + * + * [awaitFieldInitialization] method can be used on that instance. + * + * @param T the exact type of the service to be created. + * @return instance of the generated service. + */ +public inline fun RPCClient.withService(): T { + return withService(T::class) +} + +/** + * Creates instance of the generated service [T], that is able to communicate with server using RPCClient. + * + * [awaitFieldInitialization] method can be used on that instance. + * + * @param T the exact type of the service to be created. + * @param serviceKType [KType] of the service to be created. + * @return instance of the generated service. + */ +public fun RPCClient.withService(serviceKType: KType): T { + return withService(serviceKType.kClass()) +} + +/** + * Counter for locally added services. + * Used to differentiate uniques local services, regardless of their type. + */ +private val SERVICE_ID = atomic(0L) + +/** + * Creates instance of the generated service [T], that is able to communicate with server using RPCClient. + * + * [awaitFieldInitialization] method can be used on that instance. + * + * @param T the exact type of the service to be created. + * @param serviceKClass [KClass] of the service to be created. + * @return instance of the generated service. + */ +public fun RPCClient.withService(serviceKClass: KClass): T { + val provider = findRPCStubProvider>( + kClass = serviceKClass, + resultKClass = RPCStubServiceProvider::class.safeCast(), + ) + + val id = SERVICE_ID.incrementAndGet() + + return provider.withClient(id, this) +} diff --git a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/RPCClientUtils.kt b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/RPCClientUtils.kt index 04e827f9..6eddb7d6 100644 --- a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/RPCClientUtils.kt +++ b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/RPCClientUtils.kt @@ -4,63 +4,35 @@ package kotlinx.rpc.client -import kotlinx.atomicfu.atomic import kotlinx.rpc.RPC import kotlinx.rpc.RPCClient -import kotlinx.rpc.internal.RPCStubServiceProvider -import kotlinx.rpc.internal.findRPCStubProvider -import kotlinx.rpc.internal.kClass -import kotlinx.rpc.internal.safeCast +import kotlinx.rpc.withService import kotlin.reflect.KClass import kotlin.reflect.KType -/** - * Creates instance of the generated service [T], that is able to communicate with server using RPCClient. - * - * [awaitFieldInitialization] method can be used on that instance. - * - * @param T exact type of the service to be created. - * @return instance of the generated service. - */ +@Deprecated( + message = "withService was moved to kotlinx-rpc-core, to kotlinx.rpc package", + level = DeprecationLevel.WARNING, + replaceWith = ReplaceWith("withService()", "kotlinx.rpc.withService") +) public inline fun RPCClient.withService(): T { - return withService(T::class) + return withService() } -/** - * Creates instance of the generated service [T], that is able to communicate with server using RPCClient. - * - * [awaitFieldInitialization] method can be used on that instance. - * - * @param T exact type of the service to be created. - * @param serviceKType [KType] of the service to be created. - * @return instance of the generated service. - */ +@Deprecated( + message = "withService was moved to kotlinx-rpc-core, to kotlinx.rpc package", + level = DeprecationLevel.WARNING, + replaceWith = ReplaceWith("withService(serviceKType)", "kotlinx.rpc.withService") +) public fun RPCClient.withService(serviceKType: KType): T { - return withService(serviceKType.kClass()) + return withService(serviceKType) } -/** - * Counter for locally added services. - * Used to differentiate uniques local services, regardless of their type. - */ -private val SERVICE_ID = atomic(0L) - -/** - * Creates instance of the generated service [T], that is able to communicate with server using RPCClient. - * - * [awaitFieldInitialization] method can be used on that instance. - * - * @param T exact type of the service to be created. - * @param serviceKClass [KClass] of the service to be created. - * @return instance of the generated service. - */ +@Deprecated( + message = "withService was moved to kotlinx-rpc-core, to kotlinx.rpc package", + level = DeprecationLevel.WARNING, + replaceWith = ReplaceWith("withService(serviceKClass)", "kotlinx.rpc.withService") +) public fun RPCClient.withService(serviceKClass: KClass): T { - val provider = findRPCStubProvider>( - kClass = serviceKClass, - resultKClass = RPCStubServiceProvider::class.safeCast(), - ) - - val id = SERVICE_ID.incrementAndGet() - - return provider.withClient(id, this) + return withService(serviceKClass) } diff --git a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/UninitializedRPCFieldException.kt b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/UninitializedRPCFieldException.kt index 58b94558..80d18fcd 100644 --- a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/UninitializedRPCFieldException.kt +++ b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/UninitializedRPCFieldException.kt @@ -4,13 +4,20 @@ package kotlinx.rpc.client +import kotlinx.rpc.UninitializedRPCFieldException import kotlin.reflect.KProperty -/** - * Thrown when an uninitialized field of an RPC interface is accessed. - * - * Use [awaitFieldInitialization] to await for the field initialization - */ +@Deprecated( + message = "UninitializedRPCFieldException was moved to kotlinx-rpc-core, to kotlinx.rpc package", + level = DeprecationLevel.WARNING, + replaceWith = ReplaceWith( + "UninitializedRPCFieldException(serviceName, property)", + "kotlinx.rpc.UninitializedRPCFieldException", + ) +) public class UninitializedRPCFieldException(serviceName: String, property: KProperty<*>): Exception() { - override val message: String = "${property.name} field of RPC service \"$serviceName\" in not initialized" + private val inner = UninitializedRPCFieldException(serviceName, property) + + override val message: String = inner.message + override val cause: Throwable? = inner.cause } diff --git a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/awaitFieldInitialization.kt b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/awaitFieldInitialization.kt index 7483218f..0dc08d95 100644 --- a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/awaitFieldInitialization.kt +++ b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/awaitFieldInitialization.kt @@ -2,88 +2,37 @@ * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ +@file:Suppress("RedundantSuspendModifier", "UnusedReceiverParameter", "UNUSED_PARAMETER") + package kotlinx.rpc.client import kotlinx.rpc.RPC -import kotlinx.rpc.internal.RPCDeferredField -import kotlinx.rpc.internal.RPCServiceFieldsProvider -import kotlinx.rpc.internal.findRPCStubProvider -import kotlinx.rpc.internal.safeCast +import kotlinx.rpc.awaitFieldInitialization import kotlin.reflect.KClass -/** - * Waits for the initialization of an RPC field in the generated client: - * - * ```kotlin - * interface MyService : RPC { - * val stateFlow: StateFlow - * } - * - * val service = rpcClient.withService() - * val currentValue = service.awaitFieldInitialization { stateFlow }.value - * ``` - * - * @param T service type - * @param R field type - * @param getter function that returns the field of the context service to wait for. - * @return service filed after it was initialized. - */ +@Deprecated( + message = "awaitFieldInitialization was moved to kotlinx-rpc-core, to kotlinx.rpc package", + level = DeprecationLevel.WARNING, + replaceWith = ReplaceWith("awaitFieldInitialization(getter)", "kotlinx.rpc.awaitFieldInitialization") +) public suspend fun T.awaitFieldInitialization(getter: T.() -> R): R { - val field = getter() - - if (field is RPCDeferredField<*>) { - @Suppress("UNCHECKED_CAST") - return (field as RPCDeferredField).await() - } - - error("Please choose required field for a valid RPC client generated by RPCClient.withService method") + return awaitFieldInitialization(getter) } -/** - * Waits for the initialization of all RPC fields in the generated client: - * - * ```kotlin - * interface MyService : RPC { - * val stateFlow1: StateFlow - * val stateFlow2: StateFlow - * } - * - * val service = rpcClient.withService() - * val currentValue = service.awaitFieldInitialization() - * // fields `stateFlow1` and `stateFlow2` are initialized - * ``` - * - * @param T service type - * @return specified service, after all of it's field were initialized. - */ +@Deprecated( + message = "awaitFieldInitialization was moved to kotlinx-rpc-core, to kotlinx.rpc package", + level = DeprecationLevel.ERROR, + replaceWith = ReplaceWith("awaitFieldInitialization()", "kotlinx.rpc.awaitFieldInitialization") +) public suspend inline fun T.awaitFieldInitialization(): T { - return awaitFieldInitialization(T::class) + return awaitFieldInitialization() } -/** - * Waits for the initialization of all RPC fields in the generated client: - * - * ```kotlin - * interface MyService : RPC { - * val stateFlow1: StateFlow - * val stateFlow2: StateFlow - * } - * - * val service = rpcClient.withService() - * val currentValue = service.awaitFieldInitialization(MyService::class) - * // fields `stateFlow1` and `stateFlow2` are initialized - * ``` - * - * @param T service type - * @param kClass [KClass] of the [T] type. - * @return specified service, after all of it's field were initialized. - */ +@Deprecated( + message = "awaitFieldInitialization was moved to kotlinx-rpc-core, to kotlinx.rpc package", + level = DeprecationLevel.ERROR, + replaceWith = ReplaceWith("awaitFieldInitialization(kClass)", "kotlinx.rpc.awaitFieldInitialization") +) public suspend fun T.awaitFieldInitialization(kClass: KClass): T { - findRPCStubProvider>(kClass, RPCServiceFieldsProvider::class.safeCast()) - .rpcFields(this) - .forEach { field -> - field.await() - } - - return this + return awaitFieldInitialization(kClass) } diff --git a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/internal/RPCFieldProvider.kt b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/internal/RPCFieldProvider.kt index 75f16029..36910d9c 100644 --- a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/internal/RPCFieldProvider.kt +++ b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/client/internal/RPCFieldProvider.kt @@ -6,7 +6,7 @@ package kotlinx.rpc.client.internal import kotlinx.coroutines.CompletableDeferred import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.rpc.client.UninitializedRPCFieldException +import kotlinx.rpc.UninitializedRPCFieldException import kotlin.reflect.KProperty internal class RPCFieldProvider( diff --git a/krpc/krpc-ktor/krpc-ktor-core/src/jvmTest/kotlin/kotlinx/rpc/transport/ktor/KtorTransportTest.kt b/krpc/krpc-ktor/krpc-ktor-core/src/jvmTest/kotlin/kotlinx/rpc/transport/ktor/KtorTransportTest.kt index 53c1389f..b415f619 100644 --- a/krpc/krpc-ktor/krpc-ktor-core/src/jvmTest/kotlin/kotlinx/rpc/transport/ktor/KtorTransportTest.kt +++ b/krpc/krpc-ktor/krpc-ktor-core/src/jvmTest/kotlin/kotlinx/rpc/transport/ktor/KtorTransportTest.kt @@ -10,13 +10,13 @@ import io.ktor.server.application.* import io.ktor.server.testing.* import kotlinx.coroutines.cancel import kotlinx.rpc.RPC -import kotlinx.rpc.client.withService import kotlinx.rpc.serialization.json import kotlinx.rpc.transport.ktor.client.installRPC import kotlinx.rpc.transport.ktor.client.rpc import kotlinx.rpc.transport.ktor.client.rpcConfig import kotlinx.rpc.transport.ktor.server.RPC import kotlinx.rpc.transport.ktor.server.rpc +import kotlinx.rpc.withService import org.junit.Assert.assertEquals import kotlin.coroutines.CoroutineContext import kotlin.test.Test diff --git a/krpc/krpc-test/src/jvmMain/kotlin/kotlinx/rpc/test/KRPCTransportTestBase.kt b/krpc/krpc-test/src/jvmMain/kotlin/kotlinx/rpc/test/KRPCTransportTestBase.kt index a7e1efc4..879f1314 100644 --- a/krpc/krpc-test/src/jvmMain/kotlin/kotlinx/rpc/test/KRPCTransportTestBase.kt +++ b/krpc/krpc-test/src/jvmMain/kotlin/kotlinx/rpc/test/KRPCTransportTestBase.kt @@ -10,8 +10,6 @@ import kotlinx.coroutines.* import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.flow.* import kotlinx.rpc.* -import kotlinx.rpc.client.awaitFieldInitialization -import kotlinx.rpc.client.withService import kotlinx.rpc.serialization.RPCSerialFormatConfiguration import kotlinx.rpc.server.KRPCServer import org.junit.Assert.assertEquals diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/ProtocolTestBase.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/ProtocolTestBase.kt index 7af40068..a560bbf8 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/ProtocolTestBase.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/ProtocolTestBase.kt @@ -11,7 +11,6 @@ import kotlinx.coroutines.test.TestResult import kotlinx.coroutines.test.TestScope import kotlinx.rpc.* import kotlinx.rpc.client.KRPCClient -import kotlinx.rpc.client.withService import kotlinx.rpc.internal.hex.hexToReadableBinary import kotlinx.rpc.internal.logging.CommonLogger import kotlinx.rpc.internal.logging.DumpLogger diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/TransportTest.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/TransportTest.kt index 50d91a17..454a3ef4 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/TransportTest.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/TransportTest.kt @@ -7,7 +7,6 @@ package kotlinx.rpc.test import junit.framework.TestCase.assertEquals import kotlinx.coroutines.* import kotlinx.rpc.* -import kotlinx.rpc.client.withService import kotlinx.rpc.serialization.json import java.util.concurrent.atomic.AtomicInteger import kotlin.coroutines.CoroutineContext diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/api/ApiVersioningTest.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/api/ApiVersioningTest.kt index 747c0297..0b35e0b4 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/api/ApiVersioningTest.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/api/ApiVersioningTest.kt @@ -7,7 +7,7 @@ package kotlinx.rpc.test.api import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.take import kotlinx.coroutines.flow.toList -import kotlinx.rpc.client.awaitFieldInitialization +import kotlinx.rpc.awaitFieldInitialization import kotlinx.rpc.internal.transport.CancellationType import kotlinx.rpc.internal.transport.RPCMessage import kotlinx.rpc.internal.transport.RPCPlugin diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/api/WireSamplingTestScope.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/api/WireSamplingTestScope.kt index dc4a8106..cf587b88 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/api/WireSamplingTestScope.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/api/WireSamplingTestScope.kt @@ -12,7 +12,6 @@ import kotlinx.coroutines.test.TestResult import kotlinx.coroutines.test.TestScope import kotlinx.coroutines.test.runTest import kotlinx.rpc.* -import kotlinx.rpc.client.withService import kotlinx.rpc.internal.hex.hexToByteArrayInternal import kotlinx.rpc.internal.hex.hexToReadableBinary import kotlinx.rpc.internal.logging.CommonLogger diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/cancellation/CancellationTest.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/cancellation/CancellationTest.kt index 178fd862..5e28b3e1 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/cancellation/CancellationTest.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/cancellation/CancellationTest.kt @@ -8,10 +8,10 @@ import kotlinx.coroutines.* import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.toList -import kotlinx.rpc.client.withService import kotlinx.rpc.internal.STREAM_SCOPES_ENABLED import kotlinx.rpc.invokeOnStreamScopeCompletion import kotlinx.rpc.streamScoped +import kotlinx.rpc.withService import kotlin.test.* class CancellationTest { diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/cancellation/CancellationToolkit.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/cancellation/CancellationToolkit.kt index 5f1a2d88..188c9bd8 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/cancellation/CancellationToolkit.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/test/cancellation/CancellationToolkit.kt @@ -7,14 +7,10 @@ package kotlinx.rpc.test.cancellation import kotlinx.coroutines.* import kotlinx.coroutines.test.TestResult import kotlinx.coroutines.test.runTest -import kotlinx.rpc.RPCConfigBuilder -import kotlinx.rpc.client.withService +import kotlinx.rpc.* import kotlinx.rpc.internal.logging.CommonLogger import kotlinx.rpc.internal.logging.DumpLogger import kotlinx.rpc.internal.logging.DumpLoggerContainer -import kotlinx.rpc.registerService -import kotlinx.rpc.rpcClientConfig -import kotlinx.rpc.rpcServerConfig import kotlinx.rpc.serialization.json import kotlinx.rpc.test.KRPCTestClient import kotlinx.rpc.test.KRPCTestServer diff --git a/settings.gradle.kts b/settings.gradle.kts index efb6032a..c2d663e2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -58,5 +58,5 @@ includePublic(":krpc:krpc-ktor:krpc-ktor-core") includePublic(":krpc:krpc-ktor:krpc-ktor-server") includePublic(":krpc:krpc-ktor:krpc-ktor-client") -include(":tests:codegen-tests:codegen-tests-mpp") -include(":tests:codegen-tests:codegen-tests-jvm") +include(":tests") +include(":tests:compiler-plugin-tests") diff --git a/tests/codegen-tests/codegen-tests-jvm/build.gradle.kts b/tests/codegen-tests/codegen-tests-jvm/build.gradle.kts deleted file mode 100644 index e45f33d7..00000000 --- a/tests/codegen-tests/codegen-tests-jvm/build.gradle.kts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode - -plugins { - alias(libs.plugins.conventions.jvm) - alias(libs.plugins.serialization) - alias(libs.plugins.ksp) - alias(libs.plugins.kotlinx.rpc) -} - -dependencies { - implementation(projects.krpc.krpcClient) - implementation(projects.krpc.krpcServer) - - implementation(projects.tests.codegenTests.codegenTestsMpp) - - implementation(libs.kotlin.stdlib) - implementation(libs.kotlin.reflect) - implementation(libs.coroutines.core) - implementation(libs.serialization.core) - - testImplementation(libs.kotlin.test) - testImplementation(libs.slf4j.api) - testImplementation(libs.logback.classic) -} - -kotlin { - explicitApi = ExplicitApiMode.Disabled -} diff --git a/tests/codegen-tests/codegen-tests-jvm/src/main/kotlin/kotlinx/rpc/Main.kt b/tests/codegen-tests/codegen-tests-jvm/src/main/kotlin/kotlinx/rpc/Main.kt deleted file mode 100644 index 296e94c1..00000000 --- a/tests/codegen-tests/codegen-tests-jvm/src/main/kotlin/kotlinx/rpc/Main.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -@file:Suppress("unused") - -package kotlinx.rpc - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.runBlocking -import kotlinx.rpc.client.withService - -interface MainService : RPC, EmptyService { - @RPCEagerField - override val flow: Flow - - override val stateFlow: StateFlow - - override val sharedFlow: SharedFlow - - override suspend fun empty() -} - -interface FieldOnly : RPC { - val flow: Flow -} - -fun main(): Unit = runBlocking { - testService() - testService() - testService() - - stubEngine.withService().flow -} diff --git a/tests/codegen-tests/codegen-tests-jvm/src/main/kotlin/kotlinx/rpc/RootService.kt b/tests/codegen-tests/codegen-tests-jvm/src/main/kotlin/kotlinx/rpc/RootService.kt deleted file mode 100644 index 486d593c..00000000 --- a/tests/codegen-tests/codegen-tests-jvm/src/main/kotlin/kotlinx/rpc/RootService.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -@file:Suppress("unused", "detekt.MissingPackageDeclaration") - -package kotlinx.rpc - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow -import kotlinx.serialization.Serializable - -interface RootService : EmptyService, RPC { - suspend fun rootCall(data: RootData): RootResponse - - override val flow: Flow - - override val stateFlow: StateFlow - - override val sharedFlow: SharedFlow - - override suspend fun empty() -} - -@Serializable -class RootData(val hello: String) - -@Serializable -class RootResponse(val world: String) diff --git a/tests/codegen-tests/codegen-tests-jvm/src/test/kotlin/kotlinx/rpc/MainTest.kt b/tests/codegen-tests/codegen-tests-jvm/src/test/kotlin/kotlinx/rpc/MainTest.kt deleted file mode 100644 index 4fe4d40b..00000000 --- a/tests/codegen-tests/codegen-tests-jvm/src/test/kotlin/kotlinx/rpc/MainTest.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.runBlocking -import kotlin.test.Test - -interface MainServiceTest : RPC, EmptyService { - override suspend fun empty() - - override val flow: Flow - - override val sharedFlow: SharedFlow - - override val stateFlow: StateFlow -} - -class MainTest { - @Test - fun test() = testServices() - - private inline fun testServices() - where S1 : RPC, S2 : RPC, S3 : RPC, - S1 : EmptyService, S2 : EmptyService, S3 : EmptyService = - runBlocking { - testService() - testService() - testService() - } -} diff --git a/tests/codegen-tests/codegen-tests-mpp/build.gradle.kts b/tests/codegen-tests/codegen-tests-mpp/build.gradle.kts deleted file mode 100644 index b1b4b040..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/build.gradle.kts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode - -plugins { - alias(libs.plugins.conventions.kmp) - alias(libs.plugins.ksp) - alias(libs.plugins.kotlinx.rpc) - alias(libs.plugins.serialization) -} - -kotlin { - sourceSets { - val commonMain by getting { - dependencies { - implementation(libs.coroutines.core) - implementation(libs.serialization.core) - implementation(libs.kotlin.reflect) - - implementation(projects.krpc.krpcLogging) - implementation(projects.krpc.krpcClient) - implementation(projects.krpc.krpcServer) - } - } - - val commonTest by getting { - dependencies { - implementation(libs.kotlin.test) - } - } - - val jvmTest by getting { - dependencies { - implementation(libs.slf4j.api) - implementation(libs.logback.classic) - } - } - } - - js { - binaries.executable() - browser { - commonWebpackConfig { - this.sourceMaps = true - } - } - } - - explicitApi = ExplicitApiMode.Disabled -} - diff --git a/tests/codegen-tests/codegen-tests-mpp/src/commonMain/kotlin/kotlinx/rpc/Common.kt b/tests/codegen-tests/codegen-tests-mpp/src/commonMain/kotlin/kotlinx/rpc/Common.kt deleted file mode 100644 index af859fc7..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/src/commonMain/kotlin/kotlinx/rpc/Common.kt +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc - -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.* -import kotlinx.rpc.client.withService -import kotlinx.rpc.internal.logging.CommonLogger -import kotlinx.rpc.server.internal.rpcServiceMethodSerializationTypeOf -import kotlin.coroutines.CoroutineContext -import kotlin.reflect.typeOf - -val logger by lazy { - CommonLogger.logger("KSPGeneratorTest") -} - -interface EmptyService { - val flow: Flow - - val sharedFlow: SharedFlow - - val stateFlow: StateFlow - - suspend fun empty() -} - -val stubEngine = object : RPCClient { - override val coroutineContext: CoroutineContext = Job() - - override suspend fun call(call: RPCCall): T { - logger.info { "Called ${call.callableName}" } - error("ok") - } - - override fun registerPlainFlowField(serviceScope: CoroutineScope, field: RPCField): Flow { - logger.info { "registered flow: ${field.name}" } - return flow { } - } - - override fun registerSharedFlowField(serviceScope: CoroutineScope, field: RPCField): SharedFlow { - logger.info { "registered flow: ${field.name}" } - return MutableSharedFlow(1) - } - - override fun registerStateFlowField(serviceScope: CoroutineScope, field: RPCField): StateFlow { - logger.info { "registered flow: ${field.name}" } - - @Suppress("UNCHECKED_CAST") - return MutableStateFlow(null) as StateFlow - } - - override fun provideStubContext(serviceId: Long): CoroutineContext { - return coroutineContext - } -} - -interface CommonService : RPC, EmptyService { - override val flow: Flow - - override val sharedFlow: SharedFlow - - override val stateFlow: StateFlow - - override suspend fun empty() -} - -suspend inline fun testService() where T : RPC, T : EmptyService { - val test: suspend T.() -> Unit = { - runCatching { - empty() - } - - flow - sharedFlow - stateFlow - } - - stubEngine.withService().test() - stubEngine.withService(typeOf()).test() - stubEngine.withService(T::class).test() - - logger.info { rpcServiceMethodSerializationTypeOf("empty") } - logger.info { rpcServiceMethodSerializationTypeOf(typeOf(), "empty") } -} diff --git a/tests/codegen-tests/codegen-tests-mpp/src/commonTest/kotlin/kotlinx/rpc/CommonTest.kt b/tests/codegen-tests/codegen-tests-mpp/src/commonTest/kotlin/kotlinx/rpc/CommonTest.kt deleted file mode 100644 index 49d74ca3..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/src/commonTest/kotlin/kotlinx/rpc/CommonTest.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow - -interface CommonTestService : RPC, EmptyService { - override suspend fun empty() - - override val flow: Flow - - override val sharedFlow: SharedFlow - - override val stateFlow: StateFlow -} - -abstract class CommonTestSuite { - abstract fun runAsync(body: suspend () -> Unit): TestResult - - inline fun testServices(): TestResult - where S1 : RPC, S2 : RPC, S3 : RPC, S4 : RPC, - S1 : EmptyService, S2 : EmptyService, S3 : EmptyService, S4 : EmptyService = - runAsync { - testService() - testService() - testService() - testService() - } -} diff --git a/tests/codegen-tests/codegen-tests-mpp/src/jsMain/kotlin/kotlinx/rpc/Js.kt b/tests/codegen-tests/codegen-tests-mpp/src/jsMain/kotlin/kotlinx/rpc/Js.kt deleted file mode 100644 index 92c89b78..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/src/jsMain/kotlin/kotlinx/rpc/Js.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -@file:Suppress("detekt.MatchingDeclarationName") - -package kotlinx.rpc - -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.launch - -interface JsService : RPC, EmptyService { - override suspend fun empty() - - override val flow: Flow - - override val sharedFlow: SharedFlow - - override val stateFlow: StateFlow -} - -fun main() { - CoroutineScope(Dispatchers.Main).launch { - testService() - testService() - } -} diff --git a/tests/codegen-tests/codegen-tests-mpp/src/jsMain/resources/index.html b/tests/codegen-tests/codegen-tests-mpp/src/jsMain/resources/index.html deleted file mode 100644 index 1134dd1d..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/src/jsMain/resources/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - Kotlin JS kRPC Sample - - - - - diff --git a/tests/codegen-tests/codegen-tests-mpp/src/jsTest/kotlin/kotlinx/rpc/JsTest.kt b/tests/codegen-tests/codegen-tests-mpp/src/jsTest/kotlin/kotlinx/rpc/JsTest.kt deleted file mode 100644 index 51c4325e..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/src/jsTest/kotlin/kotlinx/rpc/JsTest.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc - -import kotlinx.coroutines.* -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow -import kotlin.js.Promise -import kotlin.test.Test - -interface JsTestService : RPC, EmptyService { - override suspend fun empty() - - override val flow: Flow - - override val sharedFlow: SharedFlow - - override val stateFlow: StateFlow -} - -class JsTest : CommonTestSuite>() { - @OptIn(DelicateCoroutinesApi::class) - override fun runAsync(body: suspend () -> Unit): Promise { - @Suppress("detekt.GlobalCoroutineUsage") - return GlobalScope.async( - Dispatchers.Unconfined, - block = { body() } - ).asPromise() - } - - @Test - fun test() = testServices() -} diff --git a/tests/codegen-tests/codegen-tests-mpp/src/jvmMain/kotlin/kotlinx/rpc/Jvm.kt b/tests/codegen-tests/codegen-tests-mpp/src/jvmMain/kotlin/kotlinx/rpc/Jvm.kt deleted file mode 100644 index 7726529d..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/src/jvmMain/kotlin/kotlinx/rpc/Jvm.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -@file:Suppress("detekt.MatchingDeclarationName") - -package kotlinx.rpc - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.runBlocking - -interface JvmService : RPC, EmptyService { - override suspend fun empty() - - override val flow: Flow - - override val sharedFlow: SharedFlow - - override val stateFlow: StateFlow -} - -fun main() = runBlocking { - testService() - testService() -} diff --git a/tests/codegen-tests/codegen-tests-mpp/src/jvmTest/kotlin/kotlinx/rpc/JvmTest.kt b/tests/codegen-tests/codegen-tests-mpp/src/jvmTest/kotlin/kotlinx/rpc/JvmTest.kt deleted file mode 100644 index a578aa8a..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/src/jvmTest/kotlin/kotlinx/rpc/JvmTest.kt +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.runBlocking -import org.junit.Test - -interface JvmTestService : RPC, EmptyService { - override suspend fun empty() - - override val flow: Flow - - override val sharedFlow: SharedFlow - - override val stateFlow: StateFlow -} - -class JvmTest : CommonTestSuite() { - override fun runAsync(body: suspend () -> Unit) = runBlocking { body() } - - @Test - fun test() = testServices() -} diff --git a/tests/codegen-tests/codegen-tests-mpp/src/nativeMain/kotlin/kotlinx/rpc/native/Native.kt b/tests/codegen-tests/codegen-tests-mpp/src/nativeMain/kotlin/kotlinx/rpc/native/Native.kt deleted file mode 100644 index afaef1a2..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/src/nativeMain/kotlin/kotlinx/rpc/native/Native.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -@file:Suppress("detekt.MatchingDeclarationName") - -package kotlinx.rpc.native - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.runBlocking -import kotlinx.rpc.CommonService -import kotlinx.rpc.EmptyService -import kotlinx.rpc.RPC -import kotlinx.rpc.testService - -interface NativeService : RPC, EmptyService { - override suspend fun empty() - - override val flow: Flow - - override val sharedFlow: SharedFlow - - override val stateFlow: StateFlow -} - -fun main() = runBlocking { - testService() - testService() -} diff --git a/tests/codegen-tests/codegen-tests-mpp/src/nativeTest/kotlin/kotlinx/rpc/native/NativeTest.kt b/tests/codegen-tests/codegen-tests-mpp/src/nativeTest/kotlin/kotlinx/rpc/native/NativeTest.kt deleted file mode 100644 index fb630ecf..00000000 --- a/tests/codegen-tests/codegen-tests-mpp/src/nativeTest/kotlin/kotlinx/rpc/native/NativeTest.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.native - -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow -import kotlinx.coroutines.runBlocking -import kotlinx.rpc.* -import kotlin.test.Test - -interface NativeTestService : RPC, EmptyService { - override suspend fun empty() - - override val flow: Flow - - override val sharedFlow: SharedFlow - - override val stateFlow: StateFlow -} - -class NativeTest : CommonTestSuite() { - override fun runAsync(body: suspend () -> Unit) = runBlocking { body() } - - @Test - fun test() = testServices() -} diff --git a/tests/compiler-plugin-tests/build.gradle.kts b/tests/compiler-plugin-tests/build.gradle.kts new file mode 100644 index 00000000..156e075d --- /dev/null +++ b/tests/compiler-plugin-tests/build.gradle.kts @@ -0,0 +1,174 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + java + alias(libs.plugins.conventions.jvm) +} + +// this setup – courtesy of https://github.com/demiurg906/kotlin-compiler-plugin-template/tree/master + +repositories { + maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/bootstrap") + maven("https://www.jetbrains.com/intellij-repository/releases") + maven("https://cache-redirector.jetbrains.com/intellij-dependencies") +} + +sourceSets { + test { + java.srcDir("src/test-gen") + } +} + +kotlin { + explicitApi = ExplicitApiMode.Disabled +} + +/** + * I should probably explain this. + * + * `kotlin-compiler` dependency has its inner dependency on `libs.intellij.util`. + * In fact, it packs all necessary classes inside its jar (making it fat in some sense). + * Amongst these packed classes there is `com.intellij.openapi.util.io.NioFiles`, which is used by the tests' runtime. + * + * `NioFiles` is problematic. + * It was packed with kotlin-compiler jar, but Proguard which excluded `deleteRecursively` method from it. + * It this method is called. + * So tests fail with: + * ``` + * java.lang.NoSuchMethodError: com.intellij.openapi.util.io.NioFiles.deleteRecursively(Ljava/nio/file/Path;)V + * ``` + * + * To mitigate, we need to load the proper `NioFiles` with all methods from the jar, + * which wasn't striped by the Proguard. + * This jar is `libs.intellij.util`. + * But to load the class from it, we need to guarantee + * that this jar is present earlier in the classloader's list, than the `kotlin-compiler` jar. + * + * `kotlin-compiler-embeddable` does pack the class inside its jar. + * But if you try to use it, you would eventually get `java.lang.VerifyError: Bad type on operand stack` + * and you don't want to fix it. + * + * So here we are. + * This is bad, but hey, it is working! + */ +val testPriorityRuntimeClasspath: Configuration = configurations.create("testPriorityRuntimeClasspath") + +sourceSets.test.configure { + runtimeClasspath = testPriorityRuntimeClasspath + sourceSets.test.get().runtimeClasspath +} + +dependencies { + @Suppress("UnstableApiUsage") + testPriorityRuntimeClasspath(libs.intellij.util) { isTransitive = false } + + implementation(projects.core) + + testRuntimeOnly(libs.kotlin.test) + testRuntimeOnly(libs.kotlin.script.runtime) + testRuntimeOnly(libs.kotlin.annotations.jvm) + + testImplementation(libs.serialization.plugin) + testImplementation(libs.compiler.plugin.cli) + + testImplementation(libs.kotlin.reflect) + testImplementation(libs.kotlin.compiler) + testImplementation(libs.kotlin.compiler.test.framework) + + testImplementation(libs.junit4) + + testImplementation(platform(libs.junit5.bom)) + testImplementation(libs.junit5.jupiter) + testImplementation(libs.junit5.platform.commons) + testImplementation(libs.junit5.platform.launcher) + testImplementation(libs.junit5.platform.runner) + testImplementation(libs.junit5.platform.suite.api) +} + +val globalRootDir: String by extra + +testDataRuntimeDependencies( + libs.coroutines.core, + libs.serialization.core, +) + +tasks.test { + dependsOn(tasks.getByName("jar")) + dependsOn(project(":core").tasks.getByName("jvmJar")) + dependsOn(project(":utils").tasks.getByName("jvmJar")) + + useJUnitPlatform() + + doFirst { + systemProperty("kotlinx.rpc.globalRootDir", globalRootDir) + + val updateData = (project.findProperty("kotlin.test.update.test.data") as? String) ?: "false" + systemProperty("kotlin.test.update.test.data", updateData) + + setJarPathAsProperty("org.jetbrains.kotlin.test.kotlin-stdlib", "kotlin-stdlib") + setJarPathAsProperty("org.jetbrains.kotlin.test.kotlin-stdlib-jdk8", "kotlin-stdlib-jdk8") + setJarPathAsProperty("org.jetbrains.kotlin.test.kotlin-reflect", "kotlin-reflect") + setJarPathAsProperty("org.jetbrains.kotlin.test.kotlin-test", "kotlin-test") + setJarPathAsProperty("org.jetbrains.kotlin.test.kotlin-script-runtime", "kotlin-script-runtime") + setJarPathAsProperty("org.jetbrains.kotlin.test.kotlin-annotations-jvm", "kotlin-annotations-jvm") + } +} + +tasks.withType().configureEach { + compilerOptions { + optIn.add("org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi") + optIn.add("org.jetbrains.kotlin.ir.symbols.UnsafeDuringIrConstructionAPI") + } +} + +val generateTests by tasks.creating(JavaExec::class) { + classpath = sourceSets.test.get().runtimeClasspath + mainClass.set("kotlinx.rpc.codegen.test.GenerateTestsKt") +} + +tasks.named("compileTestKotlin").configure { + finalizedBy(generateTests) +} + +fun testDataRuntimeDependencies(vararg dependencyNotations: Provider) { + dependencyNotations.forEach { + dependencies.implementation(it) + } + + tasks.test { + doFirst { + setJarPathAsProperty( + propName = "kotlinx.rpc.test.data.classpath.dependencies", + jarNames = dependencyNotations.map { it.get().name + "-jvm" }.toTypedArray(), + searchIn = project.configurations.runtimeClasspath, + ) + } + } +} + +fun Test.setJarPathAsProperty( + propName: String, + vararg jarNames: String, + searchIn: NamedDomainObjectProvider = project.configurations.testRuntimeClasspath, +) { + val includedRegex = jarNames.toSet().joinToString("|", "(", ")") { jarName -> + "$jarName-\\d.*jar" + }.toRegex() + + val path = searchIn.get() + .files + .filter { includedRegex.matches(it.name) } + .takeIf { it.isNotEmpty() } + ?.joinToString(File.pathSeparator) { it.absolutePath } + ?: run { + logger.warn("Can't find any of ${jarNames.joinToString()} in ${searchIn.get().name}") + return + } + + logger.info("Setting prop $propName=$path") + systemProperty(propName, path) +} diff --git a/tests/compiler-plugin-tests/src/main/kotlin/kotlinx/rpc/codegen/test/TestRpcClient.kt b/tests/compiler-plugin-tests/src/main/kotlin/kotlinx/rpc/codegen/test/TestRpcClient.kt new file mode 100644 index 00000000..77a88086 --- /dev/null +++ b/tests/compiler-plugin-tests/src/main/kotlin/kotlinx/rpc/codegen/test/TestRpcClient.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.codegen.test + +import kotlinx.coroutines.* +import kotlinx.coroutines.flow.* +import kotlinx.rpc.RPCCall +import kotlinx.rpc.RPCClient +import kotlinx.rpc.RPCField +import kotlin.coroutines.CoroutineContext + +@Suppress("UNCHECKED_CAST", "unused") +object TestRpcClient : RPCClient { + override val coroutineContext: CoroutineContext = Job() + + override suspend fun call(call: RPCCall): T { + return "call_42" as T + } + + override fun registerPlainFlowField(serviceScope: CoroutineScope, field: RPCField): Flow { + return flow { emit("registerPlainFlowField_42") } as Flow + } + + @OptIn(DelicateCoroutinesApi::class) + @Suppress("detekt.GlobalCoroutineUsage") + override fun registerSharedFlowField(serviceScope: CoroutineScope, field: RPCField): SharedFlow { + return MutableSharedFlow(1).also { + GlobalScope.launch { it.emit("registerSharedFlowField_42") } + } as SharedFlow + } + + override fun registerStateFlowField(serviceScope: CoroutineScope, field: RPCField): StateFlow { + return MutableStateFlow("registerStateFlowField_42") as StateFlow + } + + override fun provideStubContext(serviceId: Long): CoroutineContext { + return coroutineContext + } +} diff --git a/tests/compiler-plugin-tests/src/test-gen/kotlinx/rpc/codegen/test/runners/BoxTestGenerated.java b/tests/compiler-plugin-tests/src/test-gen/kotlinx/rpc/codegen/test/runners/BoxTestGenerated.java new file mode 100644 index 00000000..6f549748 --- /dev/null +++ b/tests/compiler-plugin-tests/src/test-gen/kotlinx/rpc/codegen/test/runners/BoxTestGenerated.java @@ -0,0 +1,57 @@ + + +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.codegen.test.runners; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link kotlinx.rpc.codegen.test.GenerateTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("src/testData/box") +@TestDataPath("$PROJECT_ROOT") +public class BoxTestGenerated extends AbstractBoxTest { + @Test + public void testAllFilesPresentInBox() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/box"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("customParameterTypes.kt") + public void testCustomParameterTypes() { + runTest("src/testData/box/customParameterTypes.kt"); + } + + @Test + @TestMetadata("fields.kt") + public void testFields() { + runTest("src/testData/box/fields.kt"); + } + + @Test + @TestMetadata("flowParameter.kt") + public void testFlowParameter() { + runTest("src/testData/box/flowParameter.kt"); + } + + @Test + @TestMetadata("multiModule.kt") + public void testMultiModule() { + runTest("src/testData/box/multiModule.kt"); + } + + @Test + @TestMetadata("simple.kt") + public void testSimple() { + runTest("src/testData/box/simple.kt"); + } +} diff --git a/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/GenerateTests.kt b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/GenerateTests.kt new file mode 100644 index 00000000..c828d595 --- /dev/null +++ b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/GenerateTests.kt @@ -0,0 +1,23 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.codegen.test + +import kotlinx.rpc.codegen.test.runners.AbstractBoxTest +import org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5 + +fun main() { + generateTestGroupSuiteWithJUnit5 { + testGroup(testDataRoot = "src/testData", testsRoot = "src/test-gen") { + // todo enable after diagnostics are done +// testClass { +// model("diagnostics") +// } + + testClass { + model("box") + } + } + } +} diff --git a/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/AbstractBoxTest.kt b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/AbstractBoxTest.kt new file mode 100644 index 00000000..bd3eeb16 --- /dev/null +++ b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/AbstractBoxTest.kt @@ -0,0 +1,70 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.codegen.test.runners + +import org.jetbrains.kotlin.platform.jvm.JvmPlatforms +import org.jetbrains.kotlin.test.FirParser +import org.jetbrains.kotlin.test.TargetBackend +import org.jetbrains.kotlin.test.backend.BlackBoxCodegenSuppressor +import org.jetbrains.kotlin.test.backend.handlers.IrTextDumpHandler +import org.jetbrains.kotlin.test.backend.handlers.IrTreeVerifierHandler +import org.jetbrains.kotlin.test.backend.handlers.JvmBoxRunner +import org.jetbrains.kotlin.test.backend.ir.JvmIrBackendFacade +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.builders.fir2IrStep +import org.jetbrains.kotlin.test.builders.irHandlersStep +import org.jetbrains.kotlin.test.builders.jvmArtifactsHandlersStep +import org.jetbrains.kotlin.test.directives.CodegenTestDirectives.DUMP_IR +import org.jetbrains.kotlin.test.directives.ConfigurationDirectives.WITH_STDLIB +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.WITH_REFLECT +import org.jetbrains.kotlin.test.directives.configureFirParser +import org.jetbrains.kotlin.test.model.DependencyKind +import org.jetbrains.kotlin.test.runners.RunnerWithTargetBackendForTestGeneratorMarker + +/* + * Containers of different directives, which can be used in tests: + * - ModuleStructureDirectives + * - LanguageSettingsDirectives + * - DiagnosticsDirectives + * - CodegenTestDirectives + * + * All of them are located in `org.jetbrains.kotlin.test.directives` package + */ +open class AbstractBoxTest : BaseTestRunner(), RunnerWithTargetBackendForTestGeneratorMarker { + override val targetBackend: TargetBackend + get() = TargetBackend.JVM_IR + + override fun TestConfigurationBuilder.configuration() { + configureFirParser(FirParser.LightTree) + + defaultDirectives { + +DUMP_IR + +WITH_STDLIB + +WITH_REFLECT + } + + commonFirWithPluginFrontendConfiguration() + + globalDefaults { + targetBackend = TargetBackend.JVM_IR + targetPlatform = JvmPlatforms.defaultJvmPlatform + dependencyKind = DependencyKind.Binary + } + + fir2IrStep() + irHandlersStep { + useHandlers( + ::IrTextDumpHandler, + ::IrTreeVerifierHandler, + ) + } + facadeStep(::JvmIrBackendFacade) + jvmArtifactsHandlersStep { + useHandlers(::JvmBoxRunner) + } + + useAfterAnalysisCheckers(::BlackBoxCodegenSuppressor) + } +} diff --git a/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/AbstractDiagnosticTest.kt b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/AbstractDiagnosticTest.kt new file mode 100644 index 00000000..fe39e147 --- /dev/null +++ b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/AbstractDiagnosticTest.kt @@ -0,0 +1,22 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.codegen.test.runners + +import org.jetbrains.kotlin.test.FirParser +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.directives.configureFirParser +import org.jetbrains.kotlin.test.services.EnvironmentBasedStandardLibrariesPathProvider +import org.jetbrains.kotlin.test.services.KotlinStandardLibrariesPathProvider + +abstract class AbstractDiagnosticTest : BaseTestRunner() { + override fun TestConfigurationBuilder.configuration() { + commonFirWithPluginFrontendConfiguration() + configureFirParser(FirParser.Psi) + } + + override fun createKotlinStandardLibrariesPathProvider(): KotlinStandardLibrariesPathProvider { + return EnvironmentBasedStandardLibrariesPathProvider + } +} diff --git a/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/BaseTestRunner.kt b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/BaseTestRunner.kt new file mode 100644 index 00000000..e1a83197 --- /dev/null +++ b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/runners/BaseTestRunner.kt @@ -0,0 +1,51 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.codegen.test.runners + +import kotlinx.rpc.codegen.test.services.ExtensionRegistrarConfigurator +import kotlinx.rpc.codegen.test.services.RpcCompileClasspathProvider +import kotlinx.rpc.codegen.test.services.RpcRuntimeClasspathProvider +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives +import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives +import org.jetbrains.kotlin.test.initIdeaConfiguration +import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerTest +import org.jetbrains.kotlin.test.runners.baseFirDiagnosticTestConfiguration +import org.jetbrains.kotlin.test.services.EnvironmentBasedStandardLibrariesPathProvider +import org.jetbrains.kotlin.test.services.KotlinStandardLibrariesPathProvider +import org.junit.jupiter.api.BeforeAll + +abstract class BaseTestRunner : AbstractKotlinCompilerTest() { + companion object { + @BeforeAll + @JvmStatic + fun setUp() { + initIdeaConfiguration() + } + } + + override fun createKotlinStandardLibrariesPathProvider(): KotlinStandardLibrariesPathProvider { + return EnvironmentBasedStandardLibrariesPathProvider + } +} + +fun TestConfigurationBuilder.commonFirWithPluginFrontendConfiguration() { + baseFirDiagnosticTestConfiguration() + + defaultDirectives { + +FirDiagnosticsDirectives.ENABLE_PLUGIN_PHASES + +FirDiagnosticsDirectives.FIR_DUMP + +JvmEnvironmentConfigurationDirectives.FULL_JDK + } + + useConfigurators( + ::RpcCompileClasspathProvider, + ::ExtensionRegistrarConfigurator, + ) + + useCustomRuntimeClasspathProviders( + ::RpcRuntimeClasspathProvider, + ) +} diff --git a/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/services/ExtensionRegistrarConfigurator.kt b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/services/ExtensionRegistrarConfigurator.kt new file mode 100644 index 00000000..0b7a3850 --- /dev/null +++ b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/services/ExtensionRegistrarConfigurator.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.codegen.test.services + +import kotlinx.rpc.codegen.registerRpcExtensions +import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.test.model.TestModule +import org.jetbrains.kotlin.test.services.EnvironmentConfigurator +import org.jetbrains.kotlin.test.services.TestServices +import org.jetbrains.kotlinx.serialization.compiler.extensions.SerializationComponentRegistrar + +class ExtensionRegistrarConfigurator(testServices: TestServices) : EnvironmentConfigurator(testServices) { + override fun CompilerPluginRegistrar.ExtensionStorage.registerCompilerExtensions( + module: TestModule, + configuration: CompilerConfiguration + ) { + registerRpcExtensions(configuration) + + // libs + SerializationComponentRegistrar.registerExtensions(this) + } +} diff --git a/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/services/RpcClasspathProviders.kt b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/services/RpcClasspathProviders.kt new file mode 100644 index 00000000..9856baae --- /dev/null +++ b/tests/compiler-plugin-tests/src/test/kotlin/kotlinx/rpc/codegen/test/services/RpcClasspathProviders.kt @@ -0,0 +1,77 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.codegen.test.services + +import org.jetbrains.kotlin.cli.jvm.config.addJvmClasspathRoot +import org.jetbrains.kotlin.config.CompilerConfiguration +import org.jetbrains.kotlin.test.model.TestModule +import org.jetbrains.kotlin.test.services.EnvironmentConfigurator +import org.jetbrains.kotlin.test.services.RuntimeClasspathProvider +import org.jetbrains.kotlin.test.services.TestServices +import org.jetbrains.kotlin.test.services.assertions +import java.io.File +import java.io.FilenameFilter + +private val globalRootDir: String = System.getProperty("kotlinx.rpc.globalRootDir") + ?: error("Global root dir is not specified") + +private class RuntimeDependency( + val dir: String, + val name: String, +) { + val filter = FilenameFilter { _, filename -> + filename.startsWith(name) && filename.endsWith(".jar") + } +} + +private object RpcClasspathProvider { + private val TEST_RUNTIME = RuntimeDependency("build/libs/", "compiler-plugin-test") + private val CORE_JVM = RuntimeDependency("$globalRootDir/core/build/libs/", "core-jvm") + private val UTILS_JVM = RuntimeDependency("$globalRootDir/utils/build/libs/", "utils-jvm") + + private const val RUNTIME_DEPENDENCIES_PROPERTY = "kotlinx.rpc.test.data.classpath.dependencies" + private val runtimeDependenciesPaths = System.getProperty(RUNTIME_DEPENDENCIES_PROPERTY) + ?.split(File.pathSeparator) + ?.map { File(it) } + ?: error("Runtime dependencies are not specified") + + fun provideClasspath(testServices: TestServices): List { + val additionalDependencies = listOf( + TEST_RUNTIME, + CORE_JVM, + UTILS_JVM, + ).map { it.getFile(testServices) } + + return runtimeDependenciesPaths + additionalDependencies + } + + private fun RuntimeDependency.getFile(testServices: TestServices): File { + fun failMessage(): String { + return "Jar file with '$name' runtime API does not exist. " + + "Please run corresponding gradle :jar (or :jvmJar) task" + } + + val libDir = File(dir) + testServices.assertions.assertTrue(libDir.exists() && libDir.isDirectory, ::failMessage) + val jar = libDir.listFiles(filter)?.firstOrNull() + ?: testServices.assertions.fail(::failMessage) + + return jar + } +} + +class RpcCompileClasspathProvider(testServices: TestServices) : EnvironmentConfigurator(testServices) { + override fun configureCompilerConfiguration(configuration: CompilerConfiguration, module: TestModule) { + RpcClasspathProvider.provideClasspath(testServices).forEach { + configuration.addJvmClasspathRoot(it) + } + } +} + +class RpcRuntimeClasspathProvider(testServices: TestServices) : RuntimeClasspathProvider(testServices) { + override fun runtimeClassPaths(module: TestModule): List { + return RpcClasspathProvider.provideClasspath(testServices) + } +} diff --git a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt new file mode 100644 index 00000000..41702034 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt @@ -0,0 +1,1132 @@ +FILE fqName: fileName:/customParameterTypes.kt + CLASS CLASS name:TestData modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + annotations: + Serializable(with = ) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestData + PROPERTY name:value visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value: kotlin.String declared in .TestData.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestData) returnType:kotlin.String + correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.TestData + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestData' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .TestData declared in .TestData.' type=.TestData origin=null + CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestData.Companion + CONSTRUCTOR GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] visibility:private <> () returnType:.TestData.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serializer visibility:public modality:FINAL <> ($this:.TestData.Companion) returnType:kotlinx.serialization.KSerializer<.TestData> + $this: VALUE_PARAMETER name: type:.TestData.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun serializer (): kotlinx.serialization.KSerializer<.TestData> declared in .TestData.Companion' + GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>] + annotations: + Deprecated(message = "This synthesized declaration should not be used directly", replaceWith = , level = GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:HIDDEN' type=kotlin.DeprecationLevel) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestData.$serializer + PROPERTY GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:descriptor visibility:public modality:FINAL [val] + overridden: + public abstract descriptor: kotlinx.serialization.descriptors.SerialDescriptor + FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestData.$serializer) returnType:kotlinx.serialization.descriptors.SerialDescriptor + correspondingProperty: PROPERTY GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:descriptor visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.TestData.$serializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final]' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + receiver: GET_VAR ': .TestData.$serializer declared in .TestData.$serializer.' type=.TestData.$serializer origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlinx.serialization.internal.PluginGeneratedSerialDescriptor [val] + CONSTRUCTOR_CALL 'public constructor (serialName: kotlin.String, generatedSerializer: kotlinx.serialization.internal.GeneratedSerializer<*>?, elementsCount: kotlin.Int) declared in kotlinx.serialization.internal.PluginGeneratedSerialDescriptor' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + serialName: CONST String type=kotlin.String value="TestData" + generatedSerializer: GET_VAR ': .TestData.$serializer declared in .TestData.$serializer' type=.TestData.$serializer origin=null + elementsCount: CONST Int type=kotlin.Int value=1 + CALL 'public final fun addElement (name: kotlin.String, isOptional: kotlin.Boolean): kotlin.Unit declared in kotlinx.serialization.internal.PluginGeneratedSerialDescriptor' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_0: kotlinx.serialization.internal.PluginGeneratedSerialDescriptor declared in .TestData.$serializer' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + name: CONST String type=kotlin.String value="value" + isOptional: CONST Boolean type=kotlin.Boolean value=false + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .TestData.$serializer declared in .TestData.$serializer' type=.TestData.$serializer origin=null + value: GET_VAR 'val tmp_0: kotlinx.serialization.internal.PluginGeneratedSerialDescriptor declared in .TestData.$serializer' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + CONSTRUCTOR GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] visibility:private <> () returnType:.TestData.$serializer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:typeParametersSerializers visibility:public modality:OPEN <> ($this:kotlinx.serialization.internal.GeneratedSerializer<.TestData>) returnType:kotlin.Array> [fake_override] + overridden: + public open fun typeParametersSerializers (): kotlin.Array> declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlinx.serialization.internal.GeneratedSerializer<.TestData> + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:childSerializers visibility:public modality:FINAL <> ($this:.TestData.$serializer) returnType:kotlin.Array> + overridden: + public abstract fun childSerializers (): kotlin.Array> declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.TestData.$serializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun childSerializers (): kotlin.Array> declared in .TestData.$serializer' + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array> origin=null + : kotlinx.serialization.KSerializer<*> + elements: VARARG type=kotlin.Array> varargElementType=kotlinx.serialization.KSerializer<*> + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:StringSerializer modality:FINAL visibility:internal superTypes:[kotlinx.serialization.KSerializer]' type=kotlinx.serialization.internal.StringSerializer + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:deserialize visibility:public modality:FINAL <> ($this:.TestData.$serializer, decoder:kotlinx.serialization.encoding.Decoder) returnType:.TestData + overridden: + public abstract fun deserialize (decoder: kotlinx.serialization.encoding.Decoder): T of kotlinx.serialization.internal.GeneratedSerializer declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.TestData.$serializer + VALUE_PARAMETER name:decoder index:0 type:kotlinx.serialization.encoding.Decoder + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlinx.serialization.descriptors.SerialDescriptor [val] + CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_VAR ': .TestData.$serializer declared in .TestData.$serializer.deserialize' type=.TestData.$serializer origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Boolean [var] + CONST Boolean type=kotlin.Boolean value=true + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.String? [var] + CONST Null type=kotlin.String? value=null + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlinx.serialization.encoding.CompositeDecoder [val] + CALL 'public abstract fun beginStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlinx.serialization.encoding.CompositeDecoder declared in kotlinx.serialization.encoding.Decoder' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + $this: GET_VAR 'decoder: kotlinx.serialization.encoding.Decoder declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.encoding.Decoder origin=null + descriptor: GET_VAR 'val tmp_1: kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public open fun decodeSequentially (): kotlin.Boolean declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Boolean origin=null + $this: GET_VAR 'val tmp_6: kotlinx.serialization.encoding.CompositeDecoder declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + then: BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_5: kotlin.String? declared in .TestData.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeStringElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int): kotlin.String declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.String origin=null + $this: GET_VAR 'val tmp_6: kotlinx.serialization.encoding.CompositeDecoder declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_1: kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + SET_VAR 'var tmp_4: kotlin.Int declared in .TestData.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public final fun or (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var tmp_4: kotlin.Int declared in .TestData.$serializer.deserialize' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: WHILE label=null origin=null + condition: GET_VAR 'var tmp_2: kotlin.Boolean declared in .TestData.$serializer.deserialize' type=kotlin.Boolean origin=null + body: BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_3: kotlin.Int declared in .TestData.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeElementIndex (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Int declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_6: kotlinx.serialization.encoding.CompositeDecoder declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_1: kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var tmp_3: kotlin.Int declared in .TestData.$serializer.deserialize' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=-1 + then: SET_VAR 'var tmp_2: kotlin.Boolean declared in .TestData.$serializer.deserialize' type=kotlin.Unit origin=EQ + CONST Boolean type=kotlin.Boolean value=false + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var tmp_3: kotlin.Int declared in .TestData.$serializer.deserialize' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_5: kotlin.String? declared in .TestData.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeStringElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int): kotlin.String declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.String origin=null + $this: GET_VAR 'val tmp_6: kotlinx.serialization.encoding.CompositeDecoder declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_1: kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + SET_VAR 'var tmp_4: kotlin.Int declared in .TestData.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public final fun or (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var tmp_4: kotlin.Int declared in .TestData.$serializer.deserialize' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor (index: kotlin.Int) declared in kotlinx.serialization.UnknownFieldException' type=kotlinx.serialization.UnknownFieldException origin=null + index: GET_VAR 'var tmp_3: kotlin.Int declared in .TestData.$serializer.deserialize' type=kotlin.Int origin=null + CALL 'public abstract fun endStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_6: kotlinx.serialization.encoding.CompositeDecoder declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_1: kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + RETURN type=kotlin.Nothing from='public final fun deserialize (decoder: kotlinx.serialization.encoding.Decoder): .TestData declared in .TestData.$serializer' + CONSTRUCTOR_CALL 'internal constructor (seen0: kotlin.Int, value: kotlin.String?, serializationConstructorMarker: kotlinx.serialization.internal.SerializationConstructorMarker?) declared in .TestData' type=.TestData origin=null + seen0: GET_VAR 'var tmp_4: kotlin.Int declared in .TestData.$serializer.deserialize' type=kotlin.Int origin=null + value: GET_VAR 'var tmp_5: kotlin.String? declared in .TestData.$serializer.deserialize' type=kotlin.String? origin=null + serializationConstructorMarker: CONST Null type=kotlin.Nothing? value=null + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serialize visibility:public modality:FINAL <> ($this:.TestData.$serializer, encoder:kotlinx.serialization.encoding.Encoder, value:.TestData) returnType:kotlin.Unit + overridden: + public abstract fun serialize (encoder: kotlinx.serialization.encoding.Encoder, value: T of kotlinx.serialization.internal.GeneratedSerializer): kotlin.Unit declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.TestData.$serializer + VALUE_PARAMETER name:encoder index:0 type:kotlinx.serialization.encoding.Encoder + VALUE_PARAMETER name:value index:1 type:.TestData + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlinx.serialization.descriptors.SerialDescriptor [val] + CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_VAR ': .TestData.$serializer declared in .TestData.$serializer.serialize' type=.TestData.$serializer origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlinx.serialization.encoding.CompositeEncoder [val] + CALL 'public abstract fun beginStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlinx.serialization.encoding.CompositeEncoder declared in kotlinx.serialization.encoding.Encoder' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + $this: GET_VAR 'encoder: kotlinx.serialization.encoding.Encoder declared in .TestData.$serializer.serialize' type=kotlinx.serialization.encoding.Encoder origin=null + descriptor: GET_VAR 'val tmp_7: kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CALL 'internal final fun write$Self (self: .TestData, output: kotlinx.serialization.encoding.CompositeEncoder, serialDesc: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in .TestData' type=kotlin.Unit origin=null + self: GET_VAR 'value: .TestData declared in .TestData.$serializer.serialize' type=.TestData origin=null + output: GET_VAR 'val tmp_8: kotlinx.serialization.encoding.CompositeEncoder declared in .TestData.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + serialDesc: GET_VAR 'val tmp_7: kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CALL 'public abstract fun endStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_8: kotlinx.serialization.encoding.CompositeEncoder declared in .TestData.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + descriptor: GET_VAR 'val tmp_7: kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CONSTRUCTOR KOTLINX_SERIALIZATION visibility:internal <> (seen0:kotlin.Int, value:kotlin.String?, serializationConstructorMarker:kotlinx.serialization.internal.SerializationConstructorMarker?) returnType:.TestData + VALUE_PARAMETER KOTLINX_SERIALIZATION name:seen0 index:0 type:kotlin.Int + VALUE_PARAMETER KOTLINX_SERIALIZATION name:value index:1 type:kotlin.String? + VALUE_PARAMETER KOTLINX_SERIALIZATION name:serializationConstructorMarker index:2 type:kotlinx.serialization.internal.SerializationConstructorMarker? + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CONST Int type=kotlin.Int value=1 + arg1: CALL 'public final fun and (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + other: GET_VAR 'seen0: kotlin.Int declared in .TestData.' type=kotlin.Int origin=null + then: CALL 'public final fun throwMissingFieldException (seen: kotlin.Int, goldenMask: kotlin.Int, descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.internal' type=kotlin.Unit origin=null + seen: GET_VAR 'seen0: kotlin.Int declared in .TestData.' type=kotlin.Int origin=null + goldenMask: CONST Int type=kotlin.Int value=1 + descriptor: CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .TestData declared in .TestData' type=.TestData origin=null + value: GET_VAR 'value: kotlin.String? declared in .TestData.' type=kotlin.String? origin=null + CONSTRUCTOR visibility:public <> (value:kotlin.String) returnType:.TestData [primary] + VALUE_PARAMETER name:value index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestData modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.TestData) returnType:kotlin.String [operator] + $this: VALUE_PARAMETER name: type:.TestData + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.String declared in .TestData' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .TestData declared in .TestData.component1' type=.TestData origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.TestData, value:kotlin.String) returnType:.TestData + $this: VALUE_PARAMETER name: type:.TestData + VALUE_PARAMETER name:value index:0 type:kotlin.String + EXPRESSION_BODY + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .TestData declared in .TestData.copy' type=.TestData origin=null + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun copy (value: kotlin.String): .TestData declared in .TestData' + CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) declared in .TestData' type=.TestData origin=null + value: GET_VAR 'value: kotlin.String declared in .TestData.copy' type=kotlin.String origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestData, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.TestData + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ + arg0: GET_VAR ': .TestData declared in .TestData.equals' type=.TestData origin=null + arg1: GET_VAR 'other: kotlin.Any? declared in .TestData.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestData' + CONST Boolean type=kotlin.Boolean value=true + WHEN type=kotlin.Unit origin=null + BRANCH + if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.TestData + GET_VAR 'other: kotlin.Any? declared in .TestData.equals' type=kotlin.Any? origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestData' + CONST Boolean type=kotlin.Boolean value=false + VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:.TestData [val] + TYPE_OP type=.TestData origin=CAST typeOperand=.TestData + GET_VAR 'other: kotlin.Any? declared in .TestData.equals' type=kotlin.Any? origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .TestData declared in .TestData.equals' type=.TestData origin=null + arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR 'val tmp_9: .TestData declared in .TestData.equals' type=.TestData origin=null + then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestData' + CONST Boolean type=kotlin.Boolean value=false + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .TestData' + CONST Boolean type=kotlin.Boolean value=true + FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestData) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.TestData + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestData' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .TestData declared in .TestData.hashCode' type=.TestData origin=null + FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestData) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.TestData + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestData' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="TestData(" + CONST String type=kotlin.String value="value=" + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .TestData declared in .TestData.toString' type=.TestData origin=null + CONST String type=kotlin.String value=")" + FUN KOTLINX_SERIALIZATION name:write$Self visibility:internal modality:FINAL <> (self:.TestData, output:kotlinx.serialization.encoding.CompositeEncoder, serialDesc:kotlinx.serialization.descriptors.SerialDescriptor) returnType:kotlin.Unit + annotations: + JvmStatic + VALUE_PARAMETER KOTLINX_SERIALIZATION name:self index:0 type:.TestData + VALUE_PARAMETER KOTLINX_SERIALIZATION name:output index:1 type:kotlinx.serialization.encoding.CompositeEncoder + VALUE_PARAMETER KOTLINX_SERIALIZATION name:serialDesc index:2 type:kotlinx.serialization.descriptors.SerialDescriptor + BLOCK_BODY + CALL 'public abstract fun encodeStringElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, value: kotlin.String): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Unit origin=null + $this: GET_VAR 'output: kotlinx.serialization.encoding.CompositeEncoder declared in .TestData.write$Self' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + descriptor: GET_VAR 'serialDesc: kotlinx.serialization.descriptors.SerialDescriptor declared in .TestData.write$Self' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + value: CALL 'public final fun (): kotlin.String declared in .TestData' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR 'self: .TestData declared in .TestData.write$Self' type=.TestData origin=null + CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RPC] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub + PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_stub_id: kotlin.Long declared in .BoxService.$rpcServiceStub.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.Long + correspondingProperty: PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final]' type=kotlin.Long origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.' type=kotlinx.rpc.RPCClient origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.rpc.RPCClient + correspondingProperty: PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final]' type=kotlinx.rpc.RPCClient origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] + EXPRESSION_BODY + CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPCClient' type=kotlin.coroutines.CoroutineContext origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext + correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion + PROPERTY name:methodNames visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun mapOf (vararg pairs: kotlin.Pair): kotlin.collections.Map declared in kotlin.collections' type=kotlin.collections.Map origin=null + : kotlin.String + : kotlin.reflect.KType + pairs: VARARG type=kotlin.Array> varargElementType=kotlin.Pair + CALL 'public final fun to (that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair origin=null + : kotlin.String + : kotlin.reflect.KType + $receiver: CONST String type=kotlin.String value="test1" + that: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.test1$rpcMethod + CALL 'public final fun to (that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair origin=null + : kotlin.String + : kotlin.reflect.KType + $receiver: CONST String type=kotlin.String value="test2" + that: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.test2$rpcMethod + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlin.collections.Map + correspondingProperty: PROPERTY name:methodNames visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final]' type=kotlin.collections.Map origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null + CONSTRUCTOR visibility:private <> () returnType:.BoxService.$rpcServiceStub.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:methodTypeOf visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, methodName:kotlin.String) returnType:kotlin.reflect.KType? + overridden: + public abstract fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:methodName index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in .BoxService.$rpcServiceStub.Companion' + CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map' type=kotlin.reflect.KType? origin=GET_ARRAY_ELEMENT + $this: CALL 'private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' type=kotlin.collections.Map origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=.BoxService.$rpcServiceStub.Companion origin=null + key: GET_VAR 'methodName: kotlin.String declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=kotlin.String origin=null + FUN name:rpcFields visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, service:.BoxService) returnType:kotlin.collections.List> + overridden: + public abstract fun rpcFields (service: T of kotlinx.rpc.internal.RPCStubObject): kotlin.collections.List> declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:service index:0 type:.BoxService + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun rpcFields (service: .BoxService): kotlin.collections.List> declared in .BoxService.$rpcServiceStub.Companion' + TYPE_OP type=kotlin.collections.List> origin=CAST typeOperand=kotlin.collections.List> + CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : kotlin.Any? + FUN name:withClient visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, serviceId:kotlin.Long, client:kotlinx.rpc.RPCClient) returnType:.BoxService + overridden: + public abstract fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): T of kotlinx.rpc.internal.RPCStubObject declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:serviceId index:0 type:kotlin.Long + VALUE_PARAMETER name:client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): .BoxService declared in .BoxService.$rpcServiceStub.Companion' + CONSTRUCTOR_CALL 'public constructor (__rpc_stub_id: kotlin.Long, __rpc_client: kotlinx.rpc.RPCClient) declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + __rpc_stub_id: GET_VAR 'serviceId: kotlin.Long declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlin.Long origin=null + __rpc_client: GET_VAR 'client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlinx.rpc.RPCClient origin=null + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] CLASS name:test1$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments] + annotations: + Serializable(with = ) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod + PROPERTY name:testData visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testData type:.TestData visibility:private [final] + EXPRESSION_BODY + GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test1$rpcMethod.' type=.TestData origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test1$rpcMethod) returnType:.TestData + correspondingProperty: PROPERTY name:testData visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .TestData declared in .BoxService.$rpcServiceStub.test1$rpcMethod' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testData type:.TestData visibility:private [final]' type=.TestData origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.test1$rpcMethod declared in .BoxService.$rpcServiceStub.test1$rpcMethod.' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null + CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod.Companion + CONSTRUCTOR GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] visibility:private <> () returnType:.BoxService.$rpcServiceStub.test1$rpcMethod.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serializer visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test1$rpcMethod.Companion) returnType:kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.test1$rpcMethod> + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun serializer (): kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.test1$rpcMethod> declared in .BoxService.$rpcServiceStub.test1$rpcMethod.Companion' + GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test1$rpcMethod>]' type=.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer + CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test1$rpcMethod>] + annotations: + Deprecated(message = "This synthesized declaration should not be used directly", replaceWith = , level = GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:HIDDEN' type=kotlin.DeprecationLevel) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer + PROPERTY GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:descriptor visibility:public modality:FINAL [val] + overridden: + public abstract descriptor: kotlinx.serialization.descriptors.SerialDescriptor + FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer) returnType:kotlinx.serialization.descriptors.SerialDescriptor + correspondingProperty: PROPERTY GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:descriptor visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final]' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.' type=.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlinx.serialization.internal.PluginGeneratedSerialDescriptor [val] + CONSTRUCTOR_CALL 'public constructor (serialName: kotlin.String, generatedSerializer: kotlinx.serialization.internal.GeneratedSerializer<*>?, elementsCount: kotlin.Int) declared in kotlinx.serialization.internal.PluginGeneratedSerialDescriptor' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + serialName: CONST String type=kotlin.String value="BoxService.$rpcServiceStub.test1$rpcMethod" + generatedSerializer: GET_VAR ': .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' type=.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer origin=null + elementsCount: CONST Int type=kotlin.Int value=1 + CALL 'public final fun addElement (name: kotlin.String, isOptional: kotlin.Boolean): kotlin.Unit declared in kotlinx.serialization.internal.PluginGeneratedSerialDescriptor' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_10: kotlinx.serialization.internal.PluginGeneratedSerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + name: CONST String type=kotlin.String value="testData" + isOptional: CONST Boolean type=kotlin.Boolean value=false + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' type=.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer origin=null + value: GET_VAR 'val tmp_10: kotlinx.serialization.internal.PluginGeneratedSerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + CONSTRUCTOR GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] visibility:private <> () returnType:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test1$rpcMethod>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:typeParametersSerializers visibility:public modality:OPEN <> ($this:kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test1$rpcMethod>) returnType:kotlin.Array> [fake_override] + overridden: + public open fun typeParametersSerializers (): kotlin.Array> declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test1$rpcMethod> + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:childSerializers visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer) returnType:kotlin.Array> + overridden: + public abstract fun childSerializers (): kotlin.Array> declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun childSerializers (): kotlin.Array> declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array> origin=null + : kotlinx.serialization.KSerializer<*> + elements: VARARG type=kotlin.Array> varargElementType=kotlinx.serialization.KSerializer<*> + GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:deserialize visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer, decoder:kotlinx.serialization.encoding.Decoder) returnType:.BoxService.$rpcServiceStub.test1$rpcMethod + overridden: + public abstract fun deserialize (decoder: kotlinx.serialization.encoding.Decoder): T of kotlinx.serialization.internal.GeneratedSerializer declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer + VALUE_PARAMETER name:decoder index:0 type:kotlinx.serialization.encoding.Decoder + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlinx.serialization.descriptors.SerialDescriptor [val] + CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_12 type:kotlin.Boolean [var] + CONST Boolean type=kotlin.Boolean value=true + VAR IR_TEMPORARY_VARIABLE name:tmp_13 type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_14 type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:.TestData? [var] + CONST Null type=.TestData? value=null + VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:kotlinx.serialization.encoding.CompositeDecoder [val] + CALL 'public abstract fun beginStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlinx.serialization.encoding.CompositeDecoder declared in kotlinx.serialization.encoding.Decoder' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + $this: GET_VAR 'decoder: kotlinx.serialization.encoding.Decoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.Decoder origin=null + descriptor: GET_VAR 'val tmp_11: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public open fun decodeSequentially (): kotlin.Boolean declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Boolean origin=null + $this: GET_VAR 'val tmp_16: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + then: BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_15: .TestData? declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeSerializableElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, deserializer: kotlinx.serialization.DeserializationStrategy, previousValue: T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement?): T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement declared in kotlinx.serialization.encoding.CompositeDecoder' type=.TestData origin=null + : .TestData + $this: GET_VAR 'val tmp_16: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_11: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + deserializer: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + previousValue: GET_VAR 'var tmp_15: .TestData? declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=.TestData? origin=null + SET_VAR 'var tmp_14: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public final fun or (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var tmp_14: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: WHILE label=null origin=null + condition: GET_VAR 'var tmp_12: kotlin.Boolean declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Boolean origin=null + body: BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_13: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeElementIndex (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Int declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_16: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_11: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var tmp_13: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=-1 + then: SET_VAR 'var tmp_12: kotlin.Boolean declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CONST Boolean type=kotlin.Boolean value=false + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var tmp_13: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_15: .TestData? declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeSerializableElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, deserializer: kotlinx.serialization.DeserializationStrategy, previousValue: T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement?): T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement declared in kotlinx.serialization.encoding.CompositeDecoder' type=.TestData origin=null + : .TestData + $this: GET_VAR 'val tmp_16: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_11: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + deserializer: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + previousValue: GET_VAR 'var tmp_15: .TestData? declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=.TestData? origin=null + SET_VAR 'var tmp_14: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public final fun or (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var tmp_14: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor (index: kotlin.Int) declared in kotlinx.serialization.UnknownFieldException' type=kotlinx.serialization.UnknownFieldException origin=null + index: GET_VAR 'var tmp_13: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + CALL 'public abstract fun endStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_16: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_11: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + RETURN type=kotlin.Nothing from='public final fun deserialize (decoder: kotlinx.serialization.encoding.Decoder): .BoxService.$rpcServiceStub.test1$rpcMethod declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' + CONSTRUCTOR_CALL 'internal constructor (seen0: kotlin.Int, testData: .TestData?, serializationConstructorMarker: kotlinx.serialization.internal.SerializationConstructorMarker?) declared in .BoxService.$rpcServiceStub.test1$rpcMethod' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null + seen0: GET_VAR 'var tmp_14: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + testData: GET_VAR 'var tmp_15: .TestData? declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=.TestData? origin=null + serializationConstructorMarker: CONST Null type=kotlin.Nothing? value=null + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serialize visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer, encoder:kotlinx.serialization.encoding.Encoder, value:.BoxService.$rpcServiceStub.test1$rpcMethod) returnType:kotlin.Unit + overridden: + public abstract fun serialize (encoder: kotlinx.serialization.encoding.Encoder, value: T of kotlinx.serialization.internal.GeneratedSerializer): kotlin.Unit declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer + VALUE_PARAMETER name:encoder index:0 type:kotlinx.serialization.encoding.Encoder + VALUE_PARAMETER name:value index:1 type:.BoxService.$rpcServiceStub.test1$rpcMethod + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:kotlinx.serialization.descriptors.SerialDescriptor [val] + CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_18 type:kotlinx.serialization.encoding.CompositeEncoder [val] + CALL 'public abstract fun beginStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlinx.serialization.encoding.CompositeEncoder declared in kotlinx.serialization.encoding.Encoder' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + $this: GET_VAR 'encoder: kotlinx.serialization.encoding.Encoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.Encoder origin=null + descriptor: GET_VAR 'val tmp_17: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CALL 'internal final fun write$Self (self: .BoxService.$rpcServiceStub.test1$rpcMethod, output: kotlinx.serialization.encoding.CompositeEncoder, serialDesc: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in .BoxService.$rpcServiceStub.test1$rpcMethod' type=kotlin.Unit origin=null + self: GET_VAR 'value: .BoxService.$rpcServiceStub.test1$rpcMethod declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null + output: GET_VAR 'val tmp_18: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + serialDesc: GET_VAR 'val tmp_17: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CALL 'public abstract fun endStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_18: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + descriptor: GET_VAR 'val tmp_17: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CONSTRUCTOR GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] visibility:public <> (testData:.TestData) returnType:.BoxService.$rpcServiceStub.test1$rpcMethod [primary] + VALUE_PARAMETER GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] name:testData index:0 type:.TestData + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] CLASS name:test1$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments]' + CONSTRUCTOR KOTLINX_SERIALIZATION visibility:internal <> (seen0:kotlin.Int, testData:.TestData?, serializationConstructorMarker:kotlinx.serialization.internal.SerializationConstructorMarker?) returnType:.BoxService.$rpcServiceStub.test1$rpcMethod + VALUE_PARAMETER KOTLINX_SERIALIZATION name:seen0 index:0 type:kotlin.Int + VALUE_PARAMETER KOTLINX_SERIALIZATION name:testData index:1 type:.TestData? + VALUE_PARAMETER KOTLINX_SERIALIZATION name:serializationConstructorMarker index:2 type:kotlinx.serialization.internal.SerializationConstructorMarker? + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CONST Int type=kotlin.Int value=1 + arg1: CALL 'public final fun and (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + other: GET_VAR 'seen0: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.' type=kotlin.Int origin=null + then: CALL 'public final fun throwMissingFieldException (seen: kotlin.Int, goldenMask: kotlin.Int, descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.internal' type=kotlin.Unit origin=null + seen: GET_VAR 'seen0: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.' type=kotlin.Int origin=null + goldenMask: CONST Int type=kotlin.Int value=1 + descriptor: CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test1$rpcMethod>]' type=.BoxService.$rpcServiceStub.test1$rpcMethod.$serializer + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testData type:.TestData visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.test1$rpcMethod declared in .BoxService.$rpcServiceStub.test1$rpcMethod' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null + value: GET_VAR 'testData: .TestData? declared in .BoxService.$rpcServiceStub.test1$rpcMethod.' type=.TestData? origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN KOTLINX_SERIALIZATION name:write$Self visibility:internal modality:FINAL <> (self:.BoxService.$rpcServiceStub.test1$rpcMethod, output:kotlinx.serialization.encoding.CompositeEncoder, serialDesc:kotlinx.serialization.descriptors.SerialDescriptor) returnType:kotlin.Unit + annotations: + JvmStatic + VALUE_PARAMETER KOTLINX_SERIALIZATION name:self index:0 type:.BoxService.$rpcServiceStub.test1$rpcMethod + VALUE_PARAMETER KOTLINX_SERIALIZATION name:output index:1 type:kotlinx.serialization.encoding.CompositeEncoder + VALUE_PARAMETER KOTLINX_SERIALIZATION name:serialDesc index:2 type:kotlinx.serialization.descriptors.SerialDescriptor + BLOCK_BODY + CALL 'public abstract fun encodeSerializableElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, serializer: kotlinx.serialization.SerializationStrategy, value: T of kotlinx.serialization.encoding.CompositeEncoder.encodeSerializableElement): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Unit origin=null + : .TestData + $this: GET_VAR 'output: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.write$Self' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + descriptor: GET_VAR 'serialDesc: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test1$rpcMethod.write$Self' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + serializer: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + value: CALL 'public final fun (): .TestData declared in .BoxService.$rpcServiceStub.test1$rpcMethod' type=.TestData origin=GET_PROPERTY + $this: GET_VAR 'self: .BoxService.$rpcServiceStub.test1$rpcMethod declared in .BoxService.$rpcServiceStub.test1$rpcMethod.write$Self' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null + FUN name:asArray visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.test1$rpcMethod) returnType:kotlin.Array + overridden: + public abstract fun asArray (): kotlin.Array declared in kotlinx.rpc.internal.RPCMethodClassArguments + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test1$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun asArray (): kotlin.Array declared in .BoxService.$rpcServiceStub.test1$rpcMethod' + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Any? + elements: VARARG type=kotlin.Array varargElementType=kotlin.Any? + CALL 'public final fun (): .TestData declared in .BoxService.$rpcServiceStub.test1$rpcMethod' type=.TestData origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.test1$rpcMethod declared in .BoxService.$rpcServiceStub.test1$rpcMethod.asArray' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] CLASS name:test2$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments] + annotations: + Serializable(with = ) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod + PROPERTY name:testData visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:testData type:.TestData visibility:private [final] + EXPRESSION_BODY + GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test2$rpcMethod.' type=.TestData origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test2$rpcMethod) returnType:.TestData + correspondingProperty: PROPERTY name:testData visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .TestData declared in .BoxService.$rpcServiceStub.test2$rpcMethod' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testData type:.TestData visibility:private [final]' type=.TestData origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.test2$rpcMethod declared in .BoxService.$rpcServiceStub.test2$rpcMethod.' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null + CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod.Companion + CONSTRUCTOR GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] visibility:private <> () returnType:.BoxService.$rpcServiceStub.test2$rpcMethod.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serializer visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test2$rpcMethod.Companion) returnType:kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.test2$rpcMethod> + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun serializer (): kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.test2$rpcMethod> declared in .BoxService.$rpcServiceStub.test2$rpcMethod.Companion' + GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test2$rpcMethod>]' type=.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer + CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test2$rpcMethod>] + annotations: + Deprecated(message = "This synthesized declaration should not be used directly", replaceWith = , level = GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:HIDDEN' type=kotlin.DeprecationLevel) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer + PROPERTY GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:descriptor visibility:public modality:FINAL [val] + overridden: + public abstract descriptor: kotlinx.serialization.descriptors.SerialDescriptor + FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer) returnType:kotlinx.serialization.descriptors.SerialDescriptor + correspondingProperty: PROPERTY GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:descriptor visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final]' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.' type=.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_19 type:kotlinx.serialization.internal.PluginGeneratedSerialDescriptor [val] + CONSTRUCTOR_CALL 'public constructor (serialName: kotlin.String, generatedSerializer: kotlinx.serialization.internal.GeneratedSerializer<*>?, elementsCount: kotlin.Int) declared in kotlinx.serialization.internal.PluginGeneratedSerialDescriptor' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + serialName: CONST String type=kotlin.String value="BoxService.$rpcServiceStub.test2$rpcMethod" + generatedSerializer: GET_VAR ': .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' type=.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer origin=null + elementsCount: CONST Int type=kotlin.Int value=1 + CALL 'public final fun addElement (name: kotlin.String, isOptional: kotlin.Boolean): kotlin.Unit declared in kotlinx.serialization.internal.PluginGeneratedSerialDescriptor' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_19: kotlinx.serialization.internal.PluginGeneratedSerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + name: CONST String type=kotlin.String value="testData" + isOptional: CONST Boolean type=kotlin.Boolean value=false + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' type=.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer origin=null + value: GET_VAR 'val tmp_19: kotlinx.serialization.internal.PluginGeneratedSerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + CONSTRUCTOR GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] visibility:private <> () returnType:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test2$rpcMethod>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:typeParametersSerializers visibility:public modality:OPEN <> ($this:kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test2$rpcMethod>) returnType:kotlin.Array> [fake_override] + overridden: + public open fun typeParametersSerializers (): kotlin.Array> declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test2$rpcMethod> + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:childSerializers visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer) returnType:kotlin.Array> + overridden: + public abstract fun childSerializers (): kotlin.Array> declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun childSerializers (): kotlin.Array> declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array> origin=null + : kotlinx.serialization.KSerializer<*> + elements: VARARG type=kotlin.Array> varargElementType=kotlinx.serialization.KSerializer<*> + GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:deserialize visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer, decoder:kotlinx.serialization.encoding.Decoder) returnType:.BoxService.$rpcServiceStub.test2$rpcMethod + overridden: + public abstract fun deserialize (decoder: kotlinx.serialization.encoding.Decoder): T of kotlinx.serialization.internal.GeneratedSerializer declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer + VALUE_PARAMETER name:decoder index:0 type:kotlinx.serialization.encoding.Decoder + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_20 type:kotlinx.serialization.descriptors.SerialDescriptor [val] + CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_21 type:kotlin.Boolean [var] + CONST Boolean type=kotlin.Boolean value=true + VAR IR_TEMPORARY_VARIABLE name:tmp_22 type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_23 type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_24 type:.TestData? [var] + CONST Null type=.TestData? value=null + VAR IR_TEMPORARY_VARIABLE name:tmp_25 type:kotlinx.serialization.encoding.CompositeDecoder [val] + CALL 'public abstract fun beginStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlinx.serialization.encoding.CompositeDecoder declared in kotlinx.serialization.encoding.Decoder' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + $this: GET_VAR 'decoder: kotlinx.serialization.encoding.Decoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.Decoder origin=null + descriptor: GET_VAR 'val tmp_20: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public open fun decodeSequentially (): kotlin.Boolean declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Boolean origin=null + $this: GET_VAR 'val tmp_25: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + then: BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_24: .TestData? declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeSerializableElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, deserializer: kotlinx.serialization.DeserializationStrategy, previousValue: T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement?): T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement declared in kotlinx.serialization.encoding.CompositeDecoder' type=.TestData origin=null + : .TestData + $this: GET_VAR 'val tmp_25: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_20: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + deserializer: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + previousValue: GET_VAR 'var tmp_24: .TestData? declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=.TestData? origin=null + SET_VAR 'var tmp_23: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public final fun or (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var tmp_23: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: WHILE label=null origin=null + condition: GET_VAR 'var tmp_21: kotlin.Boolean declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Boolean origin=null + body: BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_22: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeElementIndex (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Int declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_25: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_20: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var tmp_22: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=-1 + then: SET_VAR 'var tmp_21: kotlin.Boolean declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CONST Boolean type=kotlin.Boolean value=false + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var tmp_22: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_24: .TestData? declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeSerializableElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, deserializer: kotlinx.serialization.DeserializationStrategy, previousValue: T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement?): T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement declared in kotlinx.serialization.encoding.CompositeDecoder' type=.TestData origin=null + : .TestData + $this: GET_VAR 'val tmp_25: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_20: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + deserializer: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + previousValue: GET_VAR 'var tmp_24: .TestData? declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=.TestData? origin=null + SET_VAR 'var tmp_23: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public final fun or (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var tmp_23: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor (index: kotlin.Int) declared in kotlinx.serialization.UnknownFieldException' type=kotlinx.serialization.UnknownFieldException origin=null + index: GET_VAR 'var tmp_22: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + CALL 'public abstract fun endStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_25: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_20: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + RETURN type=kotlin.Nothing from='public final fun deserialize (decoder: kotlinx.serialization.encoding.Decoder): .BoxService.$rpcServiceStub.test2$rpcMethod declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' + CONSTRUCTOR_CALL 'internal constructor (seen0: kotlin.Int, testData: .TestData?, serializationConstructorMarker: kotlinx.serialization.internal.SerializationConstructorMarker?) declared in .BoxService.$rpcServiceStub.test2$rpcMethod' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null + seen0: GET_VAR 'var tmp_23: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + testData: GET_VAR 'var tmp_24: .TestData? declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=.TestData? origin=null + serializationConstructorMarker: CONST Null type=kotlin.Nothing? value=null + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serialize visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer, encoder:kotlinx.serialization.encoding.Encoder, value:.BoxService.$rpcServiceStub.test2$rpcMethod) returnType:kotlin.Unit + overridden: + public abstract fun serialize (encoder: kotlinx.serialization.encoding.Encoder, value: T of kotlinx.serialization.internal.GeneratedSerializer): kotlin.Unit declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer + VALUE_PARAMETER name:encoder index:0 type:kotlinx.serialization.encoding.Encoder + VALUE_PARAMETER name:value index:1 type:.BoxService.$rpcServiceStub.test2$rpcMethod + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_26 type:kotlinx.serialization.descriptors.SerialDescriptor [val] + CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_27 type:kotlinx.serialization.encoding.CompositeEncoder [val] + CALL 'public abstract fun beginStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlinx.serialization.encoding.CompositeEncoder declared in kotlinx.serialization.encoding.Encoder' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + $this: GET_VAR 'encoder: kotlinx.serialization.encoding.Encoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.Encoder origin=null + descriptor: GET_VAR 'val tmp_26: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CALL 'internal final fun write$Self (self: .BoxService.$rpcServiceStub.test2$rpcMethod, output: kotlinx.serialization.encoding.CompositeEncoder, serialDesc: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in .BoxService.$rpcServiceStub.test2$rpcMethod' type=kotlin.Unit origin=null + self: GET_VAR 'value: .BoxService.$rpcServiceStub.test2$rpcMethod declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null + output: GET_VAR 'val tmp_27: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + serialDesc: GET_VAR 'val tmp_26: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CALL 'public abstract fun endStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_27: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + descriptor: GET_VAR 'val tmp_26: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CONSTRUCTOR GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] visibility:public <> (testData:.TestData) returnType:.BoxService.$rpcServiceStub.test2$rpcMethod [primary] + VALUE_PARAMETER GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] name:testData index:0 type:.TestData + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] CLASS name:test2$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments]' + CONSTRUCTOR KOTLINX_SERIALIZATION visibility:internal <> (seen0:kotlin.Int, testData:.TestData?, serializationConstructorMarker:kotlinx.serialization.internal.SerializationConstructorMarker?) returnType:.BoxService.$rpcServiceStub.test2$rpcMethod + VALUE_PARAMETER KOTLINX_SERIALIZATION name:seen0 index:0 type:kotlin.Int + VALUE_PARAMETER KOTLINX_SERIALIZATION name:testData index:1 type:.TestData? + VALUE_PARAMETER KOTLINX_SERIALIZATION name:serializationConstructorMarker index:2 type:kotlinx.serialization.internal.SerializationConstructorMarker? + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CONST Int type=kotlin.Int value=1 + arg1: CALL 'public final fun and (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + other: GET_VAR 'seen0: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.' type=kotlin.Int origin=null + then: CALL 'public final fun throwMissingFieldException (seen: kotlin.Int, goldenMask: kotlin.Int, descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.internal' type=kotlin.Unit origin=null + seen: GET_VAR 'seen0: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.' type=kotlin.Int origin=null + goldenMask: CONST Int type=kotlin.Int value=1 + descriptor: CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.test2$rpcMethod>]' type=.BoxService.$rpcServiceStub.test2$rpcMethod.$serializer + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:testData type:.TestData visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.test2$rpcMethod declared in .BoxService.$rpcServiceStub.test2$rpcMethod' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null + value: GET_VAR 'testData: .TestData? declared in .BoxService.$rpcServiceStub.test2$rpcMethod.' type=.TestData? origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN KOTLINX_SERIALIZATION name:write$Self visibility:internal modality:FINAL <> (self:.BoxService.$rpcServiceStub.test2$rpcMethod, output:kotlinx.serialization.encoding.CompositeEncoder, serialDesc:kotlinx.serialization.descriptors.SerialDescriptor) returnType:kotlin.Unit + annotations: + JvmStatic + VALUE_PARAMETER KOTLINX_SERIALIZATION name:self index:0 type:.BoxService.$rpcServiceStub.test2$rpcMethod + VALUE_PARAMETER KOTLINX_SERIALIZATION name:output index:1 type:kotlinx.serialization.encoding.CompositeEncoder + VALUE_PARAMETER KOTLINX_SERIALIZATION name:serialDesc index:2 type:kotlinx.serialization.descriptors.SerialDescriptor + BLOCK_BODY + CALL 'public abstract fun encodeSerializableElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, serializer: kotlinx.serialization.SerializationStrategy, value: T of kotlinx.serialization.encoding.CompositeEncoder.encodeSerializableElement): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Unit origin=null + : .TestData + $this: GET_VAR 'output: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.write$Self' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + descriptor: GET_VAR 'serialDesc: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.test2$rpcMethod.write$Self' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + serializer: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.TestData>]' type=.TestData.$serializer + value: CALL 'public final fun (): .TestData declared in .BoxService.$rpcServiceStub.test2$rpcMethod' type=.TestData origin=GET_PROPERTY + $this: GET_VAR 'self: .BoxService.$rpcServiceStub.test2$rpcMethod declared in .BoxService.$rpcServiceStub.test2$rpcMethod.write$Self' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null + FUN name:asArray visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.test2$rpcMethod) returnType:kotlin.Array + overridden: + public abstract fun asArray (): kotlin.Array declared in kotlinx.rpc.internal.RPCMethodClassArguments + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.test2$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun asArray (): kotlin.Array declared in .BoxService.$rpcServiceStub.test2$rpcMethod' + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Any? + elements: VARARG type=kotlin.Array varargElementType=kotlin.Any? + CALL 'public final fun (): .TestData declared in .BoxService.$rpcServiceStub.test2$rpcMethod' type=.TestData origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.test2$rpcMethod declared in .BoxService.$rpcServiceStub.test2$rpcMethod.asArray' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null + CONSTRUCTOR visibility:public <> (__rpc_stub_id:kotlin.Long, __rpc_client:kotlinx.rpc.RPCClient) returnType:.BoxService.$rpcServiceStub [primary] + VALUE_PARAMETER name:__rpc_stub_id index:0 type:kotlin.Long + VALUE_PARAMETER name:__rpc_client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub, testData:.TestData) returnType:kotlin.String [suspend] + overridden: + public abstract fun test1 (testData: .TestData): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + VALUE_PARAMETER name:testData index:0 type:.TestData + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun test1 (testData: .TestData): kotlin.String declared in .BoxService.$rpcServiceStub' + CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + : kotlin.String + serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test1' type=kotlinx.coroutines.CoroutineScope origin=null + body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.test1' + CALL 'public abstract fun call (call: kotlinx.rpc.RPCCall): T of kotlinx.rpc.RPCClient.call declared in kotlinx.rpc.RPCClient' type=kotlin.String origin=null + : kotlin.String + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test1' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (serviceTypeString: kotlin.String, serviceId: kotlin.Long, callableName: kotlin.String, type: kotlinx.rpc.RPCCall.Type, data: kotlin.Any, dataType: kotlin.reflect.KType, returnType: kotlin.reflect.KType) declared in kotlinx.rpc.RPCCall' type=kotlinx.rpc.RPCCall origin=null + serviceTypeString: CONST String type=kotlin.String value="BoxService" + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test1' type=.BoxService.$rpcServiceStub origin=null + callableName: CONST String type=kotlin.String value="test1" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:Method' type=kotlinx.rpc.RPCCall.Type + data: CONSTRUCTOR_CALL 'public constructor (testData: .TestData) declared in .BoxService.$rpcServiceStub.test1$rpcMethod' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null + testData: GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test1' type=.TestData origin=null + dataType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.test1$rpcMethod + returnType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : kotlin.String + FUN name:test2 visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub, testData:.TestData) returnType:kotlin.String [suspend] + overridden: + public abstract fun test2 (testData: .TestData): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + VALUE_PARAMETER name:testData index:0 type:.TestData + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun test2 (testData: .TestData): kotlin.String declared in .BoxService.$rpcServiceStub' + CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + : kotlin.String + serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test2' type=kotlinx.coroutines.CoroutineScope origin=null + body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.test2' + CALL 'public abstract fun call (call: kotlinx.rpc.RPCCall): T of kotlinx.rpc.RPCClient.call declared in kotlinx.rpc.RPCClient' type=kotlin.String origin=null + : kotlin.String + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test2' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (serviceTypeString: kotlin.String, serviceId: kotlin.Long, callableName: kotlin.String, type: kotlinx.rpc.RPCCall.Type, data: kotlin.Any, dataType: kotlin.reflect.KType, returnType: kotlin.reflect.KType) declared in kotlinx.rpc.RPCCall' type=kotlinx.rpc.RPCCall origin=null + serviceTypeString: CONST String type=kotlin.String value="BoxService" + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.test2' type=.BoxService.$rpcServiceStub origin=null + callableName: CONST String type=kotlin.String value="test2" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:Method' type=kotlinx.rpc.RPCCall.Type + data: CONSTRUCTOR_CALL 'public constructor (testData: .TestData) declared in .BoxService.$rpcServiceStub.test2$rpcMethod' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null + testData: GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test2' type=.TestData origin=null + dataType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.test2$rpcMethod + returnType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test1 visibility:public modality:ABSTRACT <> ($this:.BoxService, testData:.TestData) returnType:kotlin.String [suspend] + $this: VALUE_PARAMETER name: type:.BoxService + VALUE_PARAMETER name:testData index:0 type:.TestData + FUN name:test2 visibility:public modality:ABSTRACT <> ($this:.BoxService, testData:.TestData) returnType:kotlin.String [suspend] + $this: VALUE_PARAMETER name: type:.BoxService + VALUE_PARAMETER name:testData index:0 type:.TestData + PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RPC) returnType:kotlin.coroutines.CoroutineContext [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlinx.rpc.RPC + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun runBlocking (context: kotlin.coroutines.CoroutineContext, block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): T of kotlinx.coroutines.runBlocking declared in kotlinx.coroutines' type=kotlin.String origin=null + : kotlin.String + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlinx.coroutines.CoroutineScope) returnType:kotlin.String [suspend] + $receiver: VALUE_PARAMETER name:$this$runBlocking type:kotlinx.coroutines.CoroutineScope + BLOCK_BODY + VAR name:test1 type:kotlin.String [val] + CALL 'public abstract fun test1 (testData: .TestData): kotlin.String declared in .BoxService' type=kotlin.String origin=null + $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null + : .BoxService + $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RPCClient]' type=kotlinx.rpc.codegen.test.TestRpcClient + testData: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) declared in .TestData' type=.TestData origin=null + value: CONST String type=kotlin.String value="value" + VAR name:test2 type:kotlin.String [val] + CALL 'public abstract fun test2 (testData: .TestData): kotlin.String declared in .BoxService' type=kotlin.String origin=null + $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null + : .BoxService + $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RPCClient]' type=kotlinx.rpc.codegen.test.TestRpcClient + testData: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) declared in .TestData' type=.TestData origin=null + value: CONST String type=kotlin.String value="value" + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' + WHEN type=kotlin.String origin=IF + BRANCH + if: WHEN type=kotlin.Boolean origin=ANDAND + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val test1: kotlin.String declared in .box.' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="call_42" + then: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val test2: kotlin.String declared in .box.' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="call_42" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CONST Boolean type=kotlin.Boolean value=false + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Fail: test1=" + GET_VAR 'val test1: kotlin.String declared in .box.' type=kotlin.String origin=null + CONST String type=kotlin.String value=", test2=" + GET_VAR 'val test2: kotlin.String declared in .box.' type=kotlin.String origin=null diff --git a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt new file mode 100644 index 00000000..16083527 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt @@ -0,0 +1,133 @@ +FILE: customParameterTypes.kt + @R|kotlinx/serialization/Serializable|() public final data class TestData : R|kotlin/Any| { + public constructor(value: R|kotlin/String|): R|TestData| { + super() + } + + public final val value: R|kotlin/String| = R|/value| + public get(): R|kotlin/String| + + public final operator fun component1(): R|kotlin/String| + + public final fun copy(value: R|kotlin/String| = this@R|/TestData|.R|/TestData.value|): R|TestData| + + public final companion object Companion : R|kotlin/Any| { + public final fun serializer(): R|kotlinx/serialization/KSerializer| + + private constructor(): R|TestData.Companion| { + super() + } + + } + + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final object $serializer : R|kotlinx/serialization/internal/GeneratedSerializer| { + public final override fun serialize(encoder: R|kotlinx/serialization/encoding/Encoder|, value: R|TestData|): R|kotlin/Unit| + + public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|TestData| + + public final val descriptor: R|kotlinx/serialization/descriptors/SerialDescriptor| + public get(): R|kotlinx/serialization/descriptors/SerialDescriptor| + + public final override fun childSerializers(): R|kotlin/Array>| + + private constructor(): R|TestData.$serializer| { + super() + } + + } + + } + public abstract interface BoxService : R|kotlinx/rpc/RPC| { + public abstract suspend fun test1(testData: R|TestData|): R|kotlin/String| + + public abstract suspend fun test2(testData: R|TestData|): R|kotlin/String| + + public final class $rpcServiceStub : R|kotlin/Any| { + @R|kotlinx/serialization/Serializable|() public final class test1$rpcMethod : R|kotlin/Any| { + public final val testData: R|TestData| + public get(): R|TestData| + + public constructor(testData: R|TestData|): R|BoxService.$rpcServiceStub.test1$rpcMethod| + + public final companion object Companion : R|kotlin/Any| { + public final fun serializer(): R|kotlinx/serialization/KSerializer| + + private constructor(): R|BoxService.$rpcServiceStub.test1$rpcMethod.Companion| { + super() + } + + } + + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final object $serializer : R|kotlinx/serialization/internal/GeneratedSerializer| { + public final override fun serialize(encoder: R|kotlinx/serialization/encoding/Encoder|, value: R|BoxService.$rpcServiceStub.test1$rpcMethod|): R|kotlin/Unit| + + public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|BoxService.$rpcServiceStub.test1$rpcMethod| + + public final val descriptor: R|kotlinx/serialization/descriptors/SerialDescriptor| + public get(): R|kotlinx/serialization/descriptors/SerialDescriptor| + + public final override fun childSerializers(): R|kotlin/Array>| + + private constructor(): R|BoxService.$rpcServiceStub.test1$rpcMethod.$serializer| { + super() + } + + } + + } + + @R|kotlinx/serialization/Serializable|() public final class test2$rpcMethod : R|kotlin/Any| { + public final val testData: R|TestData| + public get(): R|TestData| + + public constructor(testData: R|TestData|): R|BoxService.$rpcServiceStub.test2$rpcMethod| + + public final companion object Companion : R|kotlin/Any| { + public final fun serializer(): R|kotlinx/serialization/KSerializer| + + private constructor(): R|BoxService.$rpcServiceStub.test2$rpcMethod.Companion| { + super() + } + + } + + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final object $serializer : R|kotlinx/serialization/internal/GeneratedSerializer| { + public final override fun serialize(encoder: R|kotlinx/serialization/encoding/Encoder|, value: R|BoxService.$rpcServiceStub.test2$rpcMethod|): R|kotlin/Unit| + + public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|BoxService.$rpcServiceStub.test2$rpcMethod| + + public final val descriptor: R|kotlinx/serialization/descriptors/SerialDescriptor| + public get(): R|kotlinx/serialization/descriptors/SerialDescriptor| + + public final override fun childSerializers(): R|kotlin/Array>| + + private constructor(): R|BoxService.$rpcServiceStub.test2$rpcMethod.$serializer| { + super() + } + + } + + } + + public final companion object Companion : R|kotlin/Any| { + } + + } + + } + public final fun box(): R|kotlin/String| { + ^box R|kotlinx/coroutines/runBlocking|( = runBlocking@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/String| { + lval test1: R|kotlin/String| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.test1|(R|/TestData.TestData|(String(value))) + lval test2: R|kotlin/String| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.test2|(R|/TestData.TestData|(String(value))) + ^ when () { + ==(R|/test1|, String(call_42)) && ==(R|/test2|, String(call_42)) -> { + String(OK) + } + else -> { + (String(Fail: test1=), R|/test1|, String(, test2=), R|/test2|) + } + } + + } + ) + } diff --git a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt new file mode 100644 index 00000000..4bda5632 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt @@ -0,0 +1,26 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +import kotlinx.coroutines.flow.* +import kotlinx.coroutines.runBlocking +import kotlinx.serialization.Serializable +import kotlinx.rpc.RPC +import kotlinx.rpc.withService +import kotlinx.rpc.codegen.test.TestRpcClient + +@Serializable +data class TestData(val value: String) + +interface BoxService : RPC { + suspend fun test1(testData: TestData): String + + suspend fun test2(testData: TestData): String +} + +fun box(): String = runBlocking { + val test1 = TestRpcClient.withService().test1(TestData("value")) + val test2 = TestRpcClient.withService().test2(TestData("value")) + + if (test1 == "call_42" && test2 == "call_42") "OK" else "Fail: test1=$test1, test2=$test2" +} diff --git a/tests/compiler-plugin-tests/src/testData/box/fields.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/fields.fir.ir.txt new file mode 100644 index 00000000..4746e26a --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/fields.fir.ir.txt @@ -0,0 +1,474 @@ +FILE fqName: fileName:/fields.kt + CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RPC] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub + PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_stub_id: kotlin.Long declared in .BoxService.$rpcServiceStub.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.Long + correspondingProperty: PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final]' type=kotlin.Long origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.' type=kotlinx.rpc.RPCClient origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.rpc.RPCClient + correspondingProperty: PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final]' type=kotlinx.rpc.RPCClient origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] + EXPRESSION_BODY + CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPCClient' type=kotlin.coroutines.CoroutineContext origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext + correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:plainFlow visibility:public modality:FINAL [delegated,val] + overridden: + public abstract plainFlow: kotlinx.coroutines.flow.Flow + FIELD PROPERTY_DELEGATE name:plainFlow$delegate type:kotlin.Lazy> visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy> origin=null + : kotlinx.coroutines.flow.Flow + initializer: FUN_EXPR type=kotlin.Function0> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlinx.coroutines.flow.Flow + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.plainFlow$delegate' + CALL 'public abstract fun registerPlainFlowField (serviceScope: kotlinx.coroutines.CoroutineScope, field: kotlinx.rpc.RPCField): kotlinx.coroutines.flow.Flow declared in kotlinx.rpc.RPCClient' type=kotlinx.coroutines.flow.Flow origin=null + : kotlin.String + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=kotlinx.coroutines.CoroutineScope origin=null + field: CONSTRUCTOR_CALL 'public constructor (serviceTypeString: kotlin.String, serviceId: kotlin.Long, name: kotlin.String, type: kotlin.reflect.KType) declared in kotlinx.rpc.RPCField' type=kotlinx.rpc.RPCField origin=null + serviceTypeString: CONST String type=kotlin.String value="BoxService" + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + name: CONST String type=kotlin.String value="plainFlow" + type: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : kotlinx.coroutines.flow.Flow + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.coroutines.flow.Flow + correspondingProperty: PROPERTY name:plainFlow visibility:public modality:FINAL [delegated,val] + overridden: + public abstract fun (): kotlinx.coroutines.flow.Flow declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub' + CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlinx.coroutines.flow.Flow origin=null + : kotlinx.coroutines.flow.Flow + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:plainFlow$delegate type:kotlin.Lazy> visibility:private [final]' type=kotlin.Lazy> origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + thisRef: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + property: PROPERTY_REFERENCE 'public final plainFlow: kotlinx.coroutines.flow.Flow' field=null getter='public final fun (): kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub' setter=null type=kotlin.reflect.KProperty1<.BoxService.$rpcServiceStub, kotlinx.coroutines.flow.Flow> origin=PROPERTY_REFERENCE_FOR_DELEGATE + PROPERTY name:sharedFlow visibility:public modality:FINAL [delegated,val] + overridden: + public abstract sharedFlow: kotlinx.coroutines.flow.SharedFlow + FIELD PROPERTY_DELEGATE name:sharedFlow$delegate type:kotlin.Lazy> visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy> origin=null + : kotlinx.coroutines.flow.SharedFlow + initializer: FUN_EXPR type=kotlin.Function0> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlinx.coroutines.flow.SharedFlow + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService.$rpcServiceStub.sharedFlow$delegate' + CALL 'public abstract fun registerSharedFlowField (serviceScope: kotlinx.coroutines.CoroutineScope, field: kotlinx.rpc.RPCField): kotlinx.coroutines.flow.SharedFlow declared in kotlinx.rpc.RPCClient' type=kotlinx.coroutines.flow.SharedFlow origin=null + : kotlin.String + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=kotlinx.coroutines.CoroutineScope origin=null + field: CONSTRUCTOR_CALL 'public constructor (serviceTypeString: kotlin.String, serviceId: kotlin.Long, name: kotlin.String, type: kotlin.reflect.KType) declared in kotlinx.rpc.RPCField' type=kotlinx.rpc.RPCField origin=null + serviceTypeString: CONST String type=kotlin.String value="BoxService" + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + name: CONST String type=kotlin.String value="sharedFlow" + type: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : kotlinx.coroutines.flow.SharedFlow + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.coroutines.flow.SharedFlow + correspondingProperty: PROPERTY name:sharedFlow visibility:public modality:FINAL [delegated,val] + overridden: + public abstract fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService.$rpcServiceStub' + CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlinx.coroutines.flow.SharedFlow origin=null + : kotlinx.coroutines.flow.SharedFlow + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:sharedFlow$delegate type:kotlin.Lazy> visibility:private [final]' type=kotlin.Lazy> origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + thisRef: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + property: PROPERTY_REFERENCE 'public final sharedFlow: kotlinx.coroutines.flow.SharedFlow' field=null getter='public final fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService.$rpcServiceStub' setter=null type=kotlin.reflect.KProperty1<.BoxService.$rpcServiceStub, kotlinx.coroutines.flow.SharedFlow> origin=PROPERTY_REFERENCE_FOR_DELEGATE + PROPERTY name:stateFlow visibility:public modality:FINAL [delegated,val] + overridden: + public abstract stateFlow: kotlinx.coroutines.flow.StateFlow + FIELD PROPERTY_DELEGATE name:stateFlow$delegate type:kotlin.Lazy> visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy> origin=null + : kotlinx.coroutines.flow.StateFlow + initializer: FUN_EXPR type=kotlin.Function0> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlinx.coroutines.flow.StateFlow + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService.$rpcServiceStub.stateFlow$delegate' + CALL 'public abstract fun registerStateFlowField (serviceScope: kotlinx.coroutines.CoroutineScope, field: kotlinx.rpc.RPCField): kotlinx.coroutines.flow.StateFlow declared in kotlinx.rpc.RPCClient' type=kotlinx.coroutines.flow.StateFlow origin=null + : kotlin.String + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=kotlinx.coroutines.CoroutineScope origin=null + field: CONSTRUCTOR_CALL 'public constructor (serviceTypeString: kotlin.String, serviceId: kotlin.Long, name: kotlin.String, type: kotlin.reflect.KType) declared in kotlinx.rpc.RPCField' type=kotlinx.rpc.RPCField origin=null + serviceTypeString: CONST String type=kotlin.String value="BoxService" + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + name: CONST String type=kotlin.String value="stateFlow" + type: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : kotlinx.coroutines.flow.StateFlow + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.coroutines.flow.StateFlow + correspondingProperty: PROPERTY name:stateFlow visibility:public modality:FINAL [delegated,val] + overridden: + public abstract fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService.$rpcServiceStub' + CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlinx.coroutines.flow.StateFlow origin=null + : kotlinx.coroutines.flow.StateFlow + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:stateFlow$delegate type:kotlin.Lazy> visibility:private [final]' type=kotlin.Lazy> origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + thisRef: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + property: PROPERTY_REFERENCE 'public final stateFlow: kotlinx.coroutines.flow.StateFlow' field=null getter='public final fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService.$rpcServiceStub' setter=null type=kotlin.reflect.KProperty1<.BoxService.$rpcServiceStub, kotlinx.coroutines.flow.StateFlow> origin=PROPERTY_REFERENCE_FOR_DELEGATE + CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion + PROPERTY name:methodNames visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun emptyMap (): kotlin.collections.Map declared in kotlin.collections' type=kotlin.collections.Map origin=null + : kotlin.String + : kotlin.reflect.KType + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlin.collections.Map + correspondingProperty: PROPERTY name:methodNames visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final]' type=kotlin.collections.Map origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null + CONSTRUCTOR visibility:private <> () returnType:.BoxService.$rpcServiceStub.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:methodTypeOf visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, methodName:kotlin.String) returnType:kotlin.reflect.KType? + overridden: + public abstract fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:methodName index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in .BoxService.$rpcServiceStub.Companion' + CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map' type=kotlin.reflect.KType? origin=GET_ARRAY_ELEMENT + $this: CALL 'private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' type=kotlin.collections.Map origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=.BoxService.$rpcServiceStub.Companion origin=null + key: GET_VAR 'methodName: kotlin.String declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=kotlin.String origin=null + FUN name:rpcFields visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, service:.BoxService) returnType:kotlin.collections.List> + overridden: + public abstract fun rpcFields (service: T of kotlinx.rpc.internal.RPCStubObject): kotlin.collections.List> declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:service index:0 type:.BoxService + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun rpcFields (service: .BoxService): kotlin.collections.List> declared in .BoxService.$rpcServiceStub.Companion' + TYPE_OP type=kotlin.collections.List> origin=CAST typeOperand=kotlin.collections.List> + CALL 'public final fun listOf (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : kotlin.Any? + elements: VARARG type=kotlin.Array varargElementType=kotlin.Any? + CALL 'public abstract fun (): kotlinx.coroutines.flow.Flow declared in .BoxService' type=kotlinx.coroutines.flow.Flow origin=GET_PROPERTY + $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.rpcFields' type=.BoxService origin=null + CALL 'public abstract fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService' type=kotlinx.coroutines.flow.SharedFlow origin=GET_PROPERTY + $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.rpcFields' type=.BoxService origin=null + CALL 'public abstract fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService' type=kotlinx.coroutines.flow.StateFlow origin=GET_PROPERTY + $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.rpcFields' type=.BoxService origin=null + FUN name:withClient visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, serviceId:kotlin.Long, client:kotlinx.rpc.RPCClient) returnType:.BoxService + overridden: + public abstract fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): T of kotlinx.rpc.internal.RPCStubObject declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:serviceId index:0 type:kotlin.Long + VALUE_PARAMETER name:client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): .BoxService declared in .BoxService.$rpcServiceStub.Companion' + CONSTRUCTOR_CALL 'public constructor (__rpc_stub_id: kotlin.Long, __rpc_client: kotlinx.rpc.RPCClient) declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + __rpc_stub_id: GET_VAR 'serviceId: kotlin.Long declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlin.Long origin=null + __rpc_client: GET_VAR 'client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlinx.rpc.RPCClient origin=null + CONSTRUCTOR visibility:public <> (__rpc_stub_id:kotlin.Long, __rpc_client:kotlinx.rpc.RPCClient) returnType:.BoxService.$rpcServiceStub [primary] + VALUE_PARAMETER name:__rpc_stub_id index:0 type:kotlin.Long + VALUE_PARAMETER name:__rpc_client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RPC) returnType:kotlin.coroutines.CoroutineContext [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlinx.rpc.RPC + PROPERTY name:plainFlow visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlinx.coroutines.flow.Flow + correspondingProperty: PROPERTY name:plainFlow visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.BoxService + PROPERTY name:sharedFlow visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlinx.coroutines.flow.SharedFlow + correspondingProperty: PROPERTY name:sharedFlow visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.BoxService + PROPERTY name:stateFlow visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlinx.coroutines.flow.StateFlow + correspondingProperty: PROPERTY name:stateFlow visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.BoxService + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun runBlocking (context: kotlin.coroutines.CoroutineContext, block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): T of kotlinx.coroutines.runBlocking declared in kotlinx.coroutines' type=kotlin.String origin=null + : kotlin.String + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlinx.coroutines.CoroutineScope) returnType:kotlin.String [suspend] + $receiver: VALUE_PARAMETER name:$this$runBlocking type:kotlinx.coroutines.CoroutineScope + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' + BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.String? [val] + CALL 'public final fun withTimeoutOrNull (timeMillis: kotlin.Long, block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): T of kotlinx.coroutines.withTimeoutOrNull? declared in kotlinx.coroutines' type=kotlin.String? origin=null + : kotlin.String + timeMillis: CONST Long type=kotlin.Long value=1000 + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlinx.coroutines.CoroutineScope) returnType:kotlin.String [suspend] + $receiver: VALUE_PARAMETER name:$this$withTimeoutOrNull type:kotlinx.coroutines.CoroutineScope + BLOCK_BODY + VAR name:plainFlow type:kotlin.collections.List [val] + CALL 'public final fun toList (destination: kotlin.collections.MutableList): kotlin.collections.List declared in kotlinx.coroutines.flow' type=kotlin.collections.List origin=null + : kotlin.String + $receiver: CALL 'public abstract fun (): kotlinx.coroutines.flow.Flow declared in .BoxService' type=kotlinx.coroutines.flow.Flow origin=GET_PROPERTY + $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null + : .BoxService + $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RPCClient]' type=kotlinx.rpc.codegen.test.TestRpcClient + VAR name:sharedFlow type:kotlin.collections.List [val] + CALL 'public final fun toList (destination: kotlin.collections.MutableList): kotlin.collections.List declared in kotlinx.coroutines.flow' type=kotlin.collections.List origin=null + : kotlin.String + $receiver: CALL 'public final fun take (count: kotlin.Int): kotlinx.coroutines.flow.Flow declared in kotlinx.coroutines.flow' type=kotlinx.coroutines.flow.Flow origin=null + : kotlin.String + $receiver: CALL 'public abstract fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService' type=kotlinx.coroutines.flow.SharedFlow origin=GET_PROPERTY + $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null + : .BoxService + $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RPCClient]' type=kotlinx.rpc.codegen.test.TestRpcClient + count: CONST Int type=kotlin.Int value=1 + VAR name:stateFlow type:kotlin.String [val] + CALL 'public abstract fun (): T of kotlinx.coroutines.flow.StateFlow declared in kotlinx.coroutines.flow.StateFlow' type=kotlin.String origin=GET_PROPERTY + $this: CALL 'public abstract fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService' type=kotlinx.coroutines.flow.StateFlow origin=GET_PROPERTY + $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null + : .BoxService + $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RPCClient]' type=kotlinx.rpc.codegen.test.TestRpcClient + VAR name:failures type:kotlin.collections.MutableList [val] + CALL 'public final fun mutableListOf (): kotlin.collections.MutableList declared in kotlin.collections' type=kotlin.collections.MutableList origin=null + : kotlin.String + WHEN type=kotlin.Unit origin=IF + BRANCH + if: WHEN type=kotlin.Boolean origin=OROR + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val plainFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null + arg1: CONST Int type=kotlin.Int value=1 + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public abstract fun get (index: kotlin.Int): E of kotlin.collections.List declared in kotlin.collections.List' type=kotlin.String origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'val plainFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null + index: CONST Int type=kotlin.Int value=0 + arg1: CONST String type=kotlin.String value="registerPlainFlowField_42" + then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Boolean origin=null + CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null + $this: GET_VAR 'val failures: kotlin.collections.MutableList declared in .box..' type=kotlin.collections.MutableList origin=null + element: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS + $this: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="plainFlow.size = " + CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val plainFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null + CONST String type=kotlin.String value=" (expected 1), " + other: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="plainFlow[0] = \"" + CALL 'public final fun getOrNull (index: kotlin.Int): T of kotlin.collections.getOrNull? declared in kotlin.collections' type=kotlin.String? origin=null + : kotlin.String + $receiver: GET_VAR 'val plainFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null + index: CONST Int type=kotlin.Int value=0 + CONST String type=kotlin.String value="\" (expected \"registerPlainFlowField_42\")" + WHEN type=kotlin.Unit origin=IF + BRANCH + if: WHEN type=kotlin.Boolean origin=OROR + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val sharedFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null + arg1: CONST Int type=kotlin.Int value=1 + then: CONST Boolean type=kotlin.Boolean value=true + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CALL 'public abstract fun get (index: kotlin.Int): E of kotlin.collections.List declared in kotlin.collections.List' type=kotlin.String origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'val sharedFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null + index: CONST Int type=kotlin.Int value=0 + arg1: CONST String type=kotlin.String value="registerSharedFlowField_42" + then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Boolean origin=null + CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null + $this: GET_VAR 'val failures: kotlin.collections.MutableList declared in .box..' type=kotlin.collections.MutableList origin=null + element: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS + $this: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="sharedFlow.size = " + CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY + $this: GET_VAR 'val sharedFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null + CONST String type=kotlin.String value=" (expected 1), " + other: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="sharedFlow[0] = \"" + CALL 'public final fun getOrNull (index: kotlin.Int): T of kotlin.collections.getOrNull? declared in kotlin.collections' type=kotlin.String? origin=null + : kotlin.String + $receiver: GET_VAR 'val sharedFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null + index: CONST Int type=kotlin.Int value=0 + CONST String type=kotlin.String value="\" (expected \"registerSharedFlowField_42\")" + WHEN type=kotlin.Unit origin=IF + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: GET_VAR 'val stateFlow: kotlin.String declared in .box..' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="registerStateFlowField_42" + then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit + BLOCK type=kotlin.Boolean origin=null + CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null + $this: GET_VAR 'val failures: kotlin.collections.MutableList declared in .box..' type=kotlin.collections.MutableList origin=null + element: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="stateFlow = \"" + GET_VAR 'val stateFlow: kotlin.String declared in .box..' type=kotlin.String origin=null + CONST String type=kotlin.String value="\" (expected \"registerStateFlowField_42\")" + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box.' + BLOCK type=kotlin.String origin=ELVIS + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] + BLOCK type=kotlin.String? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] + BLOCK type=kotlin.String? origin=SAFE_CALL + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.MutableList? [val] + CALL 'public final fun takeIf (predicate: kotlin.Function1): T of kotlin.takeIf? declared in kotlin' type=kotlin.collections.MutableList? origin=null + : kotlin.collections.MutableList + $receiver: GET_VAR 'val failures: kotlin.collections.MutableList declared in .box..' type=kotlin.collections.MutableList origin=null + predicate: FUN_EXPR type=kotlin.Function1, kotlin.Boolean> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.collections.MutableList) returnType:kotlin.Boolean + VALUE_PARAMETER name:it index:0 type:kotlin.collections.MutableList + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.collections.MutableList): kotlin.Boolean declared in .box..' + CALL 'public final fun isNotEmpty (): kotlin.Boolean declared in kotlin.collections' type=kotlin.Boolean origin=null + : kotlin.String + $receiver: GET_VAR 'it: kotlin.collections.MutableList declared in .box...' type=kotlin.collections.MutableList origin=null + WHEN type=kotlin.String? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_3: kotlin.collections.MutableList? declared in .box..' type=kotlin.collections.MutableList? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun joinToString (separator: kotlin.CharSequence, prefix: kotlin.CharSequence, postfix: kotlin.CharSequence, limit: kotlin.Int, truncated: kotlin.CharSequence, transform: kotlin.Function1?): kotlin.String declared in kotlin.collections' type=kotlin.String origin=null + : kotlin.String + $receiver: GET_VAR 'val tmp_3: kotlin.collections.MutableList? declared in .box..' type=kotlin.collections.MutableList? origin=null + separator: CONST String type=kotlin.String value=";" + WHEN type=kotlin.String? origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_2: kotlin.String? declared in .box..' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST Null type=kotlin.Nothing? value=null + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=kotlin.String origin=null + : kotlin.String + : kotlin.String + $receiver: GET_VAR 'val tmp_2: kotlin.String? declared in .box..' type=kotlin.String? origin=null + block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.String + VALUE_PARAMETER name:it index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (it: kotlin.String): kotlin.String declared in .box..' + STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Fail: " + GET_VAR 'it: kotlin.String declared in .box...' type=kotlin.String origin=null + WHEN type=kotlin.String origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_1: kotlin.String? declared in .box..' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_1: kotlin.String? declared in .box..' type=kotlin.String? origin=null + WHEN type=kotlin.String origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val tmp_0: kotlin.String? declared in .box.' type=kotlin.String? origin=null + arg1: CONST Null type=kotlin.Nothing? value=null + then: CONST String type=kotlin.String value="Fail: test timed out" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: GET_VAR 'val tmp_0: kotlin.String? declared in .box.' type=kotlin.String? origin=null diff --git a/tests/compiler-plugin-tests/src/testData/box/fields.fir.txt b/tests/compiler-plugin-tests/src/testData/box/fields.fir.txt new file mode 100644 index 00000000..4fd39dbf --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/fields.fir.txt @@ -0,0 +1,55 @@ +FILE: fields.kt + public abstract interface BoxService : R|kotlinx/rpc/RPC| { + public abstract val plainFlow: R|kotlinx/coroutines/flow/Flow| + public get(): R|kotlinx/coroutines/flow/Flow| + + public abstract val sharedFlow: R|kotlinx/coroutines/flow/SharedFlow| + public get(): R|kotlinx/coroutines/flow/SharedFlow| + + public abstract val stateFlow: R|kotlinx/coroutines/flow/StateFlow| + public get(): R|kotlinx/coroutines/flow/StateFlow| + + public final class $rpcServiceStub : R|kotlin/Any| { + public final companion object Companion : R|kotlin/Any| { + } + + } + + } + public final fun box(): R|kotlin/String| { + ^box R|kotlinx/coroutines/runBlocking|( = runBlocking@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/String| { + ^ R|kotlinx/coroutines/withTimeoutOrNull|(Long(1000), = withTimeoutOrNull@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/String| { + lval plainFlow: R|kotlin/collections/List| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.plainFlow|.R|kotlinx/coroutines/flow/toList|() + lval sharedFlow: R|kotlin/collections/List| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.sharedFlow|.R|kotlinx/coroutines/flow/take|(Int(1)).R|kotlinx/coroutines/flow/toList|() + lval stateFlow: R|kotlin/String| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.stateFlow|.R|SubstitutionOverride| + lval failures: R|kotlin/collections/MutableList| = R|kotlin/collections/mutableListOf|() + when () { + !=(R|/plainFlow|.R|SubstitutionOverride|, Int(1)) || !=(R|/plainFlow|.R|SubstitutionOverride|(Int(0)), String(registerPlainFlowField_42)) -> { + R|/failures|.R|SubstitutionOverride|((String(plainFlow.size = ), R|/plainFlow|.R|SubstitutionOverride|, String( (expected 1), )).R|kotlin/String.plus|((String(plainFlow[0] = ), Char("), R|/plainFlow|.R|kotlin/collections/getOrNull|(Int(0)), Char("), String( (expected ), Char("), String(registerPlainFlowField_42), Char("), String())))) + } + } + + when () { + !=(R|/sharedFlow|.R|SubstitutionOverride|, Int(1)) || !=(R|/sharedFlow|.R|SubstitutionOverride|(Int(0)), String(registerSharedFlowField_42)) -> { + R|/failures|.R|SubstitutionOverride|((String(sharedFlow.size = ), R|/sharedFlow|.R|SubstitutionOverride|, String( (expected 1), )).R|kotlin/String.plus|((String(sharedFlow[0] = ), Char("), R|/sharedFlow|.R|kotlin/collections/getOrNull|(Int(0)), Char("), String( (expected ), Char("), String(registerSharedFlowField_42), Char("), String())))) + } + } + + when () { + !=(R|/stateFlow|, String(registerStateFlowField_42)) -> { + R|/failures|.R|SubstitutionOverride|((String(stateFlow = ), Char("), R|/stateFlow|, Char("), String( (expected ), Char("), String(registerStateFlowField_42), Char("), String()))) + } + } + + ^ R|/failures|.R|kotlin/takeIf||>( = takeIf@fun (it: R|kotlin/collections/MutableList|): R|kotlin/Boolean| { + ^ R|/it|.R|kotlin/collections/isNotEmpty|() + } + )?.{ $subj$.R|kotlin/collections/joinToString|(String(;)) }?.{ $subj$.R|kotlin/let|( = let@fun (it: R|kotlin/String|): R|kotlin/String| { + ^ (String(Fail: ), R|/it|) + } + ) } ?: String(OK) + } + ) ?: String(Fail: test timed out) + } + ) + } diff --git a/tests/compiler-plugin-tests/src/testData/box/fields.kt b/tests/compiler-plugin-tests/src/testData/box/fields.kt new file mode 100644 index 00000000..1c35cdc9 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/fields.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +import kotlinx.coroutines.* +import kotlinx.coroutines.flow.* +import kotlinx.rpc.RPC +import kotlinx.rpc.withService +import kotlinx.rpc.codegen.test.TestRpcClient + +interface BoxService : RPC { + val plainFlow: Flow + + val sharedFlow: SharedFlow + + val stateFlow: StateFlow +} + +fun box(): String = runBlocking { + withTimeoutOrNull(1000) { + val plainFlow = TestRpcClient.withService().plainFlow.toList() + val sharedFlow = TestRpcClient.withService().sharedFlow.take(1).toList() + val stateFlow = TestRpcClient.withService().stateFlow.value + + val failures = mutableListOf() + + if (plainFlow.size != 1 || plainFlow[0] != "registerPlainFlowField_42") { + failures.add( + "plainFlow.size = ${plainFlow.size} (expected 1), " + + "plainFlow[0] = \"${plainFlow.getOrNull(0)}\" (expected \"registerPlainFlowField_42\")" + ) + } + + if (sharedFlow.size != 1 || sharedFlow[0] != "registerSharedFlowField_42") { + failures.add( + "sharedFlow.size = ${sharedFlow.size} (expected 1), " + + "sharedFlow[0] = \"${sharedFlow.getOrNull(0)}\" (expected \"registerSharedFlowField_42\")" + ) + } + + if (stateFlow != "registerStateFlowField_42") { + failures.add("stateFlow = \"$stateFlow\" (expected \"registerStateFlowField_42\")") + } + + failures.takeIf { it.isNotEmpty() } + ?.joinToString(";") + ?.let { "Fail: $it" } + ?: "OK" + } ?: "Fail: test timed out" +} diff --git a/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.ir.txt new file mode 100644 index 00000000..3c50d546 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.ir.txt @@ -0,0 +1,535 @@ +FILE fqName: fileName:/flowParameter.kt + CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RPC] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub + PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_stub_id: kotlin.Long declared in .BoxService.$rpcServiceStub.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.Long + correspondingProperty: PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final]' type=kotlin.Long origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.' type=kotlinx.rpc.RPCClient origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.rpc.RPCClient + correspondingProperty: PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final]' type=kotlinx.rpc.RPCClient origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] + EXPRESSION_BODY + CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPCClient' type=kotlin.coroutines.CoroutineContext origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext + correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion + PROPERTY name:methodNames visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun mapOf (vararg pairs: kotlin.Pair): kotlin.collections.Map declared in kotlin.collections' type=kotlin.collections.Map origin=null + : kotlin.String + : kotlin.reflect.KType + pairs: VARARG type=kotlin.Array> varargElementType=kotlin.Pair + CALL 'public final fun to (that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair origin=null + : kotlin.String + : kotlin.reflect.KType + $receiver: CONST String type=kotlin.String value="stream" + that: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.stream$rpcMethod + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlin.collections.Map + correspondingProperty: PROPERTY name:methodNames visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final]' type=kotlin.collections.Map origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null + CONSTRUCTOR visibility:private <> () returnType:.BoxService.$rpcServiceStub.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:methodTypeOf visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, methodName:kotlin.String) returnType:kotlin.reflect.KType? + overridden: + public abstract fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:methodName index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in .BoxService.$rpcServiceStub.Companion' + CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map' type=kotlin.reflect.KType? origin=GET_ARRAY_ELEMENT + $this: CALL 'private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' type=kotlin.collections.Map origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=.BoxService.$rpcServiceStub.Companion origin=null + key: GET_VAR 'methodName: kotlin.String declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=kotlin.String origin=null + FUN name:rpcFields visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, service:.BoxService) returnType:kotlin.collections.List> + overridden: + public abstract fun rpcFields (service: T of kotlinx.rpc.internal.RPCStubObject): kotlin.collections.List> declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:service index:0 type:.BoxService + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun rpcFields (service: .BoxService): kotlin.collections.List> declared in .BoxService.$rpcServiceStub.Companion' + TYPE_OP type=kotlin.collections.List> origin=CAST typeOperand=kotlin.collections.List> + CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : kotlin.Any? + FUN name:withClient visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, serviceId:kotlin.Long, client:kotlinx.rpc.RPCClient) returnType:.BoxService + overridden: + public abstract fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): T of kotlinx.rpc.internal.RPCStubObject declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:serviceId index:0 type:kotlin.Long + VALUE_PARAMETER name:client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): .BoxService declared in .BoxService.$rpcServiceStub.Companion' + CONSTRUCTOR_CALL 'public constructor (__rpc_stub_id: kotlin.Long, __rpc_client: kotlinx.rpc.RPCClient) declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + __rpc_stub_id: GET_VAR 'serviceId: kotlin.Long declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlin.Long origin=null + __rpc_client: GET_VAR 'client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlinx.rpc.RPCClient origin=null + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] CLASS name:stream$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments] + annotations: + Serializable(with = ) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod + PROPERTY name:flow visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:flow type:kotlinx.coroutines.flow.Flow visibility:private [final] + EXPRESSION_BODY + GET_VAR 'flow: kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.stream$rpcMethod.' type=kotlinx.coroutines.flow.Flow origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.stream$rpcMethod) returnType:kotlinx.coroutines.flow.Flow + correspondingProperty: PROPERTY name:flow visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.stream$rpcMethod' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:flow type:kotlinx.coroutines.flow.Flow visibility:private [final]' type=kotlinx.coroutines.flow.Flow origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.stream$rpcMethod declared in .BoxService.$rpcServiceStub.stream$rpcMethod.' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null + CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod.Companion + PROPERTY KOTLINX_SERIALIZATION name:$childSerializers visibility:public modality:FINAL [val] + FIELD KOTLINX_SERIALIZATION name:$childSerializers type:kotlin.Array> visibility:private [final] + annotations: + JvmField + EXPRESSION_BODY + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array> origin=null + : kotlinx.serialization.KSerializer + elements: VARARG type=kotlin.Array> varargElementType=kotlinx.serialization.KSerializer + CONSTRUCTOR_CALL 'internal constructor (baseClass: kotlin.reflect.KClass, classAnnotations: kotlin.Array) declared in kotlinx.serialization.PolymorphicSerializer' type=kotlinx.serialization.PolymorphicSerializer> origin=null + : + baseClass: CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB INTERFACE name:Flow modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' type=kotlin.reflect.KClass<*> + classAnnotations: CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Annotation + elements: VARARG type=kotlin.Array varargElementType=kotlin.Annotation + FUN KOTLINX_SERIALIZATION name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.stream$rpcMethod.Companion) returnType:kotlin.Array> + correspondingProperty: PROPERTY KOTLINX_SERIALIZATION name:$childSerializers visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Array> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.Companion' + GET_FIELD 'FIELD KOTLINX_SERIALIZATION name:$childSerializers type:kotlin.Array> visibility:private [final]' type=kotlin.Array> origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.stream$rpcMethod.Companion declared in .BoxService.$rpcServiceStub.stream$rpcMethod.Companion.' type=.BoxService.$rpcServiceStub.stream$rpcMethod.Companion origin=null + CONSTRUCTOR GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] visibility:private <> () returnType:.BoxService.$rpcServiceStub.stream$rpcMethod.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serializer visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.stream$rpcMethod.Companion) returnType:kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.stream$rpcMethod> + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun serializer (): kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.stream$rpcMethod> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.Companion' + GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.stream$rpcMethod>]' type=.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer + CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.stream$rpcMethod>] + annotations: + Deprecated(message = "This synthesized declaration should not be used directly", replaceWith = , level = GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:HIDDEN' type=kotlin.DeprecationLevel) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer + PROPERTY GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:descriptor visibility:public modality:FINAL [val] + overridden: + public abstract descriptor: kotlinx.serialization.descriptors.SerialDescriptor + FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer) returnType:kotlinx.serialization.descriptors.SerialDescriptor + correspondingProperty: PROPERTY GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:descriptor visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final]' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.' type=.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer origin=null + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlinx.serialization.internal.PluginGeneratedSerialDescriptor [val] + CONSTRUCTOR_CALL 'public constructor (serialName: kotlin.String, generatedSerializer: kotlinx.serialization.internal.GeneratedSerializer<*>?, elementsCount: kotlin.Int) declared in kotlinx.serialization.internal.PluginGeneratedSerialDescriptor' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + serialName: CONST String type=kotlin.String value="BoxService.$rpcServiceStub.stream$rpcMethod" + generatedSerializer: GET_VAR ': .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' type=.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer origin=null + elementsCount: CONST Int type=kotlin.Int value=1 + CALL 'public final fun addElement (name: kotlin.String, isOptional: kotlin.Boolean): kotlin.Unit declared in kotlinx.serialization.internal.PluginGeneratedSerialDescriptor' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_0: kotlinx.serialization.internal.PluginGeneratedSerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + name: CONST String type=kotlin.String value="flow" + isOptional: CONST Boolean type=kotlin.Boolean value=false + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:descriptor type:kotlinx.serialization.descriptors.SerialDescriptor visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' type=.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer origin=null + value: GET_VAR 'val tmp_0: kotlinx.serialization.internal.PluginGeneratedSerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' type=kotlinx.serialization.internal.PluginGeneratedSerialDescriptor origin=null + CONSTRUCTOR GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] visibility:private <> () returnType:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.stream$rpcMethod>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:typeParametersSerializers visibility:public modality:OPEN <> ($this:kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.stream$rpcMethod>) returnType:kotlin.Array> [fake_override] + overridden: + public open fun typeParametersSerializers (): kotlin.Array> declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.stream$rpcMethod> + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:childSerializers visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer) returnType:kotlin.Array> + overridden: + public abstract fun childSerializers (): kotlin.Array> declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Array> [val] + CALL 'private final fun (): kotlin.Array> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.Companion' type=kotlin.Array> origin=null + $this: GET_OBJECT 'CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.BoxService.$rpcServiceStub.stream$rpcMethod.Companion + RETURN type=kotlin.Nothing from='public final fun childSerializers (): kotlin.Array> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array> origin=null + : kotlinx.serialization.KSerializer<*> + elements: VARARG type=kotlin.Array> varargElementType=kotlinx.serialization.KSerializer<*> + CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=T of kotlin.Array origin=null + $this: GET_VAR 'val tmp_1: kotlin.Array> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.childSerializers' type=kotlin.Array> origin=null + index: CONST Int type=kotlin.Int value=0 + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:deserialize visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer, decoder:kotlinx.serialization.encoding.Decoder) returnType:.BoxService.$rpcServiceStub.stream$rpcMethod + overridden: + public abstract fun deserialize (decoder: kotlinx.serialization.encoding.Decoder): T of kotlinx.serialization.internal.GeneratedSerializer declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer + VALUE_PARAMETER name:decoder index:0 type:kotlinx.serialization.encoding.Decoder + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlinx.serialization.descriptors.SerialDescriptor [val] + CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.Boolean [var] + CONST Boolean type=kotlin.Boolean value=true + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Int [var] + CONST Int type=kotlin.Int value=0 + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlinx.coroutines.flow.Flow? [var] + CONST Null type=kotlinx.coroutines.flow.Flow? value=null + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlinx.serialization.encoding.CompositeDecoder [val] + CALL 'public abstract fun beginStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlinx.serialization.encoding.CompositeDecoder declared in kotlinx.serialization.encoding.Decoder' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + $this: GET_VAR 'decoder: kotlinx.serialization.encoding.Decoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.Decoder origin=null + descriptor: GET_VAR 'val tmp_2: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.Array> [val] + CALL 'private final fun (): kotlin.Array> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.Companion' type=kotlin.Array> origin=null + $this: GET_OBJECT 'CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.BoxService.$rpcServiceStub.stream$rpcMethod.Companion + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public open fun decodeSequentially (): kotlin.Boolean declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Boolean origin=null + $this: GET_VAR 'val tmp_7: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + then: BLOCK type=kotlin.Unit origin=null + BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_6: kotlinx.coroutines.flow.Flow? declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeSerializableElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, deserializer: kotlinx.serialization.DeserializationStrategy, previousValue: T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement?): T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlinx.coroutines.flow.Flow origin=null + : kotlinx.coroutines.flow.Flow + $this: GET_VAR 'val tmp_7: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_2: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + deserializer: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=T of kotlin.Array origin=null + $this: GET_VAR 'val tmp_8: kotlin.Array> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Array> origin=null + index: CONST Int type=kotlin.Int value=0 + previousValue: GET_VAR 'var tmp_6: kotlinx.coroutines.flow.Flow? declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.coroutines.flow.Flow? origin=null + SET_VAR 'var tmp_5: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public final fun or (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var tmp_5: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: WHILE label=null origin=null + condition: GET_VAR 'var tmp_3: kotlin.Boolean declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Boolean origin=null + body: BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_4: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeElementIndex (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Int declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_7: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_2: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var tmp_4: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=-1 + then: SET_VAR 'var tmp_3: kotlin.Boolean declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CONST Boolean type=kotlin.Boolean value=false + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'var tmp_4: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + arg1: CONST Int type=kotlin.Int value=0 + then: BLOCK type=kotlin.Unit origin=null + SET_VAR 'var tmp_6: kotlinx.coroutines.flow.Flow? declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public abstract fun decodeSerializableElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, deserializer: kotlinx.serialization.DeserializationStrategy, previousValue: T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement?): T of kotlinx.serialization.encoding.CompositeDecoder.decodeSerializableElement declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlinx.coroutines.flow.Flow origin=null + : kotlinx.coroutines.flow.Flow + $this: GET_VAR 'val tmp_7: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_2: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + deserializer: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=T of kotlin.Array origin=null + $this: GET_VAR 'val tmp_8: kotlin.Array> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Array> origin=null + index: CONST Int type=kotlin.Int value=0 + previousValue: GET_VAR 'var tmp_6: kotlinx.coroutines.flow.Flow? declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.coroutines.flow.Flow? origin=null + SET_VAR 'var tmp_5: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Unit origin=EQ + CALL 'public final fun or (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'var tmp_5: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: THROW type=kotlin.Nothing + CONSTRUCTOR_CALL 'public constructor (index: kotlin.Int) declared in kotlinx.serialization.UnknownFieldException' type=kotlinx.serialization.UnknownFieldException origin=null + index: GET_VAR 'var tmp_4: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + CALL 'public abstract fun endStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeDecoder' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_7: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null + descriptor: GET_VAR 'val tmp_2: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + RETURN type=kotlin.Nothing from='public final fun deserialize (decoder: kotlinx.serialization.encoding.Decoder): .BoxService.$rpcServiceStub.stream$rpcMethod declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' + CONSTRUCTOR_CALL 'internal constructor (seen0: kotlin.Int, flow: kotlinx.coroutines.flow.Flow?, serializationConstructorMarker: kotlinx.serialization.internal.SerializationConstructorMarker?) declared in .BoxService.$rpcServiceStub.stream$rpcMethod' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null + seen0: GET_VAR 'var tmp_5: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null + flow: GET_VAR 'var tmp_6: kotlinx.coroutines.flow.Flow? declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.coroutines.flow.Flow? origin=null + serializationConstructorMarker: CONST Null type=kotlin.Nothing? value=null + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serialize visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer, encoder:kotlinx.serialization.encoding.Encoder, value:.BoxService.$rpcServiceStub.stream$rpcMethod) returnType:kotlin.Unit + overridden: + public abstract fun serialize (encoder: kotlinx.serialization.encoding.Encoder, value: T of kotlinx.serialization.internal.GeneratedSerializer): kotlin.Unit declared in kotlinx.serialization.internal.GeneratedSerializer + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer + VALUE_PARAMETER name:encoder index:0 type:kotlinx.serialization.encoding.Encoder + VALUE_PARAMETER name:value index:1 type:.BoxService.$rpcServiceStub.stream$rpcMethod + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlinx.serialization.descriptors.SerialDescriptor [val] + CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:kotlinx.serialization.encoding.CompositeEncoder [val] + CALL 'public abstract fun beginStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlinx.serialization.encoding.CompositeEncoder declared in kotlinx.serialization.encoding.Encoder' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + $this: GET_VAR 'encoder: kotlinx.serialization.encoding.Encoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.Encoder origin=null + descriptor: GET_VAR 'val tmp_9: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CALL 'internal final fun write$Self (self: .BoxService.$rpcServiceStub.stream$rpcMethod, output: kotlinx.serialization.encoding.CompositeEncoder, serialDesc: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in .BoxService.$rpcServiceStub.stream$rpcMethod' type=kotlin.Unit origin=null + self: GET_VAR 'value: .BoxService.$rpcServiceStub.stream$rpcMethod declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null + output: GET_VAR 'val tmp_10: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + serialDesc: GET_VAR 'val tmp_9: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CALL 'public abstract fun endStructure (descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Unit origin=null + $this: GET_VAR 'val tmp_10: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + descriptor: GET_VAR 'val tmp_9: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + CONSTRUCTOR GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] visibility:public <> (flow:kotlinx.coroutines.flow.Flow) returnType:.BoxService.$rpcServiceStub.stream$rpcMethod [primary] + VALUE_PARAMETER GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] name:flow index:0 type:kotlinx.coroutines.flow.Flow + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] CLASS name:stream$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments]' + CONSTRUCTOR KOTLINX_SERIALIZATION visibility:internal <> (seen0:kotlin.Int, flow:kotlinx.coroutines.flow.Flow?, serializationConstructorMarker:kotlinx.serialization.internal.SerializationConstructorMarker?) returnType:.BoxService.$rpcServiceStub.stream$rpcMethod + VALUE_PARAMETER KOTLINX_SERIALIZATION name:seen0 index:0 type:kotlin.Int + VALUE_PARAMETER KOTLINX_SERIALIZATION name:flow index:1 type:kotlinx.coroutines.flow.Flow? + VALUE_PARAMETER KOTLINX_SERIALIZATION name:serializationConstructorMarker index:2 type:kotlinx.serialization.internal.SerializationConstructorMarker? + BLOCK_BODY + WHEN type=kotlin.Unit origin=null + BRANCH + if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + arg0: CONST Int type=kotlin.Int value=1 + arg1: CALL 'public final fun and (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 + other: GET_VAR 'seen0: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.' type=kotlin.Int origin=null + then: CALL 'public final fun throwMissingFieldException (seen: kotlin.Int, goldenMask: kotlin.Int, descriptor: kotlinx.serialization.descriptors.SerialDescriptor): kotlin.Unit declared in kotlinx.serialization.internal' type=kotlin.Unit origin=null + seen: GET_VAR 'seen0: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.' type=kotlin.Int origin=null + goldenMask: CONST Int type=kotlin.Int value=1 + descriptor: CALL 'public final fun (): kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer' type=kotlinx.serialization.descriptors.SerialDescriptor origin=GET_PROPERTY + $this: GET_OBJECT 'CLASS KOTLINX_SERIALIZATION OBJECT name:$serializer modality:FINAL visibility:public superTypes:[kotlinx.serialization.internal.GeneratedSerializer<.BoxService.$rpcServiceStub.stream$rpcMethod>]' type=.BoxService.$rpcServiceStub.stream$rpcMethod.$serializer + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:flow type:kotlinx.coroutines.flow.Flow visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.stream$rpcMethod declared in .BoxService.$rpcServiceStub.stream$rpcMethod' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null + value: GET_VAR 'flow: kotlinx.coroutines.flow.Flow? declared in .BoxService.$rpcServiceStub.stream$rpcMethod.' type=kotlinx.coroutines.flow.Flow? origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN KOTLINX_SERIALIZATION name:write$Self visibility:internal modality:FINAL <> (self:.BoxService.$rpcServiceStub.stream$rpcMethod, output:kotlinx.serialization.encoding.CompositeEncoder, serialDesc:kotlinx.serialization.descriptors.SerialDescriptor) returnType:kotlin.Unit + annotations: + JvmStatic + VALUE_PARAMETER KOTLINX_SERIALIZATION name:self index:0 type:.BoxService.$rpcServiceStub.stream$rpcMethod + VALUE_PARAMETER KOTLINX_SERIALIZATION name:output index:1 type:kotlinx.serialization.encoding.CompositeEncoder + VALUE_PARAMETER KOTLINX_SERIALIZATION name:serialDesc index:2 type:kotlinx.serialization.descriptors.SerialDescriptor + BLOCK_BODY + VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Array> [val] + CALL 'private final fun (): kotlin.Array> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.Companion' type=kotlin.Array> origin=null + $this: GET_OBJECT 'CLASS GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlin.Any]' type=.BoxService.$rpcServiceStub.stream$rpcMethod.Companion + CALL 'public abstract fun encodeSerializableElement (descriptor: kotlinx.serialization.descriptors.SerialDescriptor, index: kotlin.Int, serializer: kotlinx.serialization.SerializationStrategy, value: T of kotlinx.serialization.encoding.CompositeEncoder.encodeSerializableElement): kotlin.Unit declared in kotlinx.serialization.encoding.CompositeEncoder' type=kotlin.Unit origin=null + : kotlinx.coroutines.flow.Flow + $this: GET_VAR 'output: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.write$Self' type=kotlinx.serialization.encoding.CompositeEncoder origin=null + descriptor: GET_VAR 'serialDesc: kotlinx.serialization.descriptors.SerialDescriptor declared in .BoxService.$rpcServiceStub.stream$rpcMethod.write$Self' type=kotlinx.serialization.descriptors.SerialDescriptor origin=null + index: CONST Int type=kotlin.Int value=0 + serializer: CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=T of kotlin.Array origin=null + $this: GET_VAR 'val tmp_11: kotlin.Array> declared in .BoxService.$rpcServiceStub.stream$rpcMethod.write$Self' type=kotlin.Array> origin=null + index: CONST Int type=kotlin.Int value=0 + value: CALL 'public final fun (): kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.stream$rpcMethod' type=kotlinx.coroutines.flow.Flow origin=GET_PROPERTY + $this: GET_VAR 'self: .BoxService.$rpcServiceStub.stream$rpcMethod declared in .BoxService.$rpcServiceStub.stream$rpcMethod.write$Self' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null + FUN name:asArray visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.stream$rpcMethod) returnType:kotlin.Array + overridden: + public abstract fun asArray (): kotlin.Array declared in kotlinx.rpc.internal.RPCMethodClassArguments + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.stream$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun asArray (): kotlin.Array declared in .BoxService.$rpcServiceStub.stream$rpcMethod' + CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Any? + elements: VARARG type=kotlin.Array varargElementType=kotlin.Any? + CALL 'public final fun (): kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.stream$rpcMethod' type=kotlinx.coroutines.flow.Flow origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.stream$rpcMethod declared in .BoxService.$rpcServiceStub.stream$rpcMethod.asArray' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null + CONSTRUCTOR visibility:public <> (__rpc_stub_id:kotlin.Long, __rpc_client:kotlinx.rpc.RPCClient) returnType:.BoxService.$rpcServiceStub [primary] + VALUE_PARAMETER name:__rpc_stub_id index:0 type:kotlin.Long + VALUE_PARAMETER name:__rpc_client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:stream visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub, flow:kotlinx.coroutines.flow.Flow) returnType:kotlin.String [suspend] + overridden: + public abstract fun stream (flow: kotlinx.coroutines.flow.Flow): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + VALUE_PARAMETER name:flow index:0 type:kotlinx.coroutines.flow.Flow + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun stream (flow: kotlinx.coroutines.flow.Flow): kotlin.String declared in .BoxService.$rpcServiceStub' + CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + : kotlin.String + serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.stream' type=kotlinx.coroutines.CoroutineScope origin=null + body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.stream' + CALL 'public abstract fun call (call: kotlinx.rpc.RPCCall): T of kotlinx.rpc.RPCClient.call declared in kotlinx.rpc.RPCClient' type=kotlin.String origin=null + : kotlin.String + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.stream' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (serviceTypeString: kotlin.String, serviceId: kotlin.Long, callableName: kotlin.String, type: kotlinx.rpc.RPCCall.Type, data: kotlin.Any, dataType: kotlin.reflect.KType, returnType: kotlin.reflect.KType) declared in kotlinx.rpc.RPCCall' type=kotlinx.rpc.RPCCall origin=null + serviceTypeString: CONST String type=kotlin.String value="BoxService" + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.stream' type=.BoxService.$rpcServiceStub origin=null + callableName: CONST String type=kotlin.String value="stream" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:Method' type=kotlinx.rpc.RPCCall.Type + data: CONSTRUCTOR_CALL 'public constructor (flow: kotlinx.coroutines.flow.Flow) declared in .BoxService.$rpcServiceStub.stream$rpcMethod' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null + flow: GET_VAR 'flow: kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.stream' type=kotlinx.coroutines.flow.Flow origin=null + dataType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.stream$rpcMethod + returnType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:stream visibility:public modality:ABSTRACT <> ($this:.BoxService, flow:kotlinx.coroutines.flow.Flow) returnType:kotlin.String [suspend] + $this: VALUE_PARAMETER name: type:.BoxService + VALUE_PARAMETER name:flow index:0 type:kotlinx.coroutines.flow.Flow + PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RPC) returnType:kotlin.coroutines.CoroutineContext [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlinx.rpc.RPC + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun runBlocking (context: kotlin.coroutines.CoroutineContext, block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): T of kotlinx.coroutines.runBlocking declared in kotlinx.coroutines' type=kotlin.String origin=null + : kotlin.String + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlinx.coroutines.CoroutineScope) returnType:kotlin.String [suspend] + $receiver: VALUE_PARAMETER name:$this$runBlocking type:kotlinx.coroutines.CoroutineScope + BLOCK_BODY + VAR name:result type:kotlin.String [val] + CALL 'public abstract fun stream (flow: kotlinx.coroutines.flow.Flow): kotlin.String declared in .BoxService' type=kotlin.String origin=null + $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null + : .BoxService + $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RPCClient]' type=kotlinx.rpc.codegen.test.TestRpcClient + flow: CALL 'public final fun flow (block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1, kotlin.Unit>): kotlinx.coroutines.flow.Flow declared in kotlinx.coroutines.flow' type=kotlinx.coroutines.flow.Flow origin=null + : kotlin.String + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1, kotlin.Unit> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlinx.coroutines.flow.FlowCollector) returnType:kotlin.Unit [suspend] + $receiver: VALUE_PARAMETER name:$this$flow type:kotlinx.coroutines.flow.FlowCollector + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .box.' + GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val result: kotlin.String declared in .box.' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="call_42" + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Fail: " + GET_VAR 'val result: kotlin.String declared in .box.' type=kotlin.String origin=null diff --git a/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt new file mode 100644 index 00000000..bb9b6aa2 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt @@ -0,0 +1,62 @@ +FILE: flowParameter.kt + public abstract interface BoxService : R|kotlinx/rpc/RPC| { + public abstract suspend fun stream(flow: R|kotlinx/coroutines/flow/Flow|): R|kotlin/String| + + public final class $rpcServiceStub : R|kotlin/Any| { + @R|kotlinx/serialization/Serializable|() public final class stream$rpcMethod : R|kotlin/Any| { + @R|kotlinx/serialization/Contextual|() public final val flow: R|kotlinx/coroutines/flow/Flow| + public get(): R|kotlinx/coroutines/flow/Flow| + + public constructor(flow: R|kotlinx/coroutines/flow/Flow|): R|BoxService.$rpcServiceStub.stream$rpcMethod| + + public final companion object Companion : R|kotlin/Any| { + public final fun serializer(): R|kotlinx/serialization/KSerializer| + + private constructor(): R|BoxService.$rpcServiceStub.stream$rpcMethod.Companion| { + super() + } + + } + + @R|kotlin/Deprecated|(message = String(This synthesized declaration should not be used directly), level = Q|kotlin/DeprecationLevel|.R|kotlin/DeprecationLevel.HIDDEN|) public final object $serializer : R|kotlinx/serialization/internal/GeneratedSerializer| { + public final override fun serialize(encoder: R|kotlinx/serialization/encoding/Encoder|, value: R|BoxService.$rpcServiceStub.stream$rpcMethod|): R|kotlin/Unit| + + public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|BoxService.$rpcServiceStub.stream$rpcMethod| + + public final val descriptor: R|kotlinx/serialization/descriptors/SerialDescriptor| + public get(): R|kotlinx/serialization/descriptors/SerialDescriptor| + + public final override fun childSerializers(): R|kotlin/Array>| + + private constructor(): R|BoxService.$rpcServiceStub.stream$rpcMethod.$serializer| { + super() + } + + } + + } + + public final companion object Companion : R|kotlin/Any| { + } + + } + + } + public final fun box(): R|kotlin/String| { + ^box R|kotlinx/coroutines/runBlocking|( = runBlocking@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/String| { + lval result: R|kotlin/String| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.stream|(R|kotlinx/coroutines/flow/flow|( = flow@fun R|kotlinx/coroutines/flow/FlowCollector|.(): R|kotlin/Unit| { + ^@flow Unit + } + )) + ^ when () { + ==(R|/result|, String(call_42)) -> { + String(OK) + } + else -> { + (String(Fail: ), R|/result|) + } + } + + } + ) + } diff --git a/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt b/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt new file mode 100644 index 00000000..06362e39 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt @@ -0,0 +1,20 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +import kotlinx.coroutines.flow.* +import kotlinx.coroutines.runBlocking +import kotlinx.rpc.RPC +import kotlinx.rpc.withService +import kotlinx.rpc.codegen.test.TestRpcClient + +interface BoxService : RPC { + // plugin should add @Contextual annotation to the flow parameter in the generated class + suspend fun stream(flow: Flow): String +} + +fun box(): String = runBlocking { + val result = TestRpcClient.withService().stream(flow { }) + + if (result == "call_42") "OK" else "Fail: $result" +} diff --git a/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.ir.txt new file mode 100644 index 00000000..b529cd78 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.ir.txt @@ -0,0 +1,279 @@ +Module: lib +FILE fqName: fileName:/module_lib_multiModule.kt + CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RPC] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub + PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_stub_id: kotlin.Long declared in .BoxService.$rpcServiceStub.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.Long + correspondingProperty: PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final]' type=kotlin.Long origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.' type=kotlinx.rpc.RPCClient origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.rpc.RPCClient + correspondingProperty: PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final]' type=kotlinx.rpc.RPCClient origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] + EXPRESSION_BODY + CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPCClient' type=kotlin.coroutines.CoroutineContext origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext + correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion + PROPERTY name:methodNames visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun mapOf (vararg pairs: kotlin.Pair): kotlin.collections.Map declared in kotlin.collections' type=kotlin.collections.Map origin=null + : kotlin.String + : kotlin.reflect.KType + pairs: VARARG type=kotlin.Array> varargElementType=kotlin.Pair + CALL 'public final fun to (that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair origin=null + : kotlin.String + : kotlin.reflect.KType + $receiver: CONST String type=kotlin.String value="simple" + that: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.simple$rpcMethod + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlin.collections.Map + correspondingProperty: PROPERTY name:methodNames visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final]' type=kotlin.collections.Map origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null + CONSTRUCTOR visibility:private <> () returnType:.BoxService.$rpcServiceStub.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:methodTypeOf visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, methodName:kotlin.String) returnType:kotlin.reflect.KType? + overridden: + public abstract fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:methodName index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in .BoxService.$rpcServiceStub.Companion' + CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map' type=kotlin.reflect.KType? origin=GET_ARRAY_ELEMENT + $this: CALL 'private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' type=kotlin.collections.Map origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=.BoxService.$rpcServiceStub.Companion origin=null + key: GET_VAR 'methodName: kotlin.String declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=kotlin.String origin=null + FUN name:rpcFields visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, service:.BoxService) returnType:kotlin.collections.List> + overridden: + public abstract fun rpcFields (service: T of kotlinx.rpc.internal.RPCStubObject): kotlin.collections.List> declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:service index:0 type:.BoxService + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun rpcFields (service: .BoxService): kotlin.collections.List> declared in .BoxService.$rpcServiceStub.Companion' + TYPE_OP type=kotlin.collections.List> origin=CAST typeOperand=kotlin.collections.List> + CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : kotlin.Any? + FUN name:withClient visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, serviceId:kotlin.Long, client:kotlinx.rpc.RPCClient) returnType:.BoxService + overridden: + public abstract fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): T of kotlinx.rpc.internal.RPCStubObject declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:serviceId index:0 type:kotlin.Long + VALUE_PARAMETER name:client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): .BoxService declared in .BoxService.$rpcServiceStub.Companion' + CONSTRUCTOR_CALL 'public constructor (__rpc_stub_id: kotlin.Long, __rpc_client: kotlinx.rpc.RPCClient) declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + __rpc_stub_id: GET_VAR 'serviceId: kotlin.Long declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlin.Long origin=null + __rpc_client: GET_VAR 'client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlinx.rpc.RPCClient origin=null + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments] + annotations: + Serializable(with = ) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.simple$rpcMethod + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD KOTLINX_SERIALIZATION name:$cachedSerializer$delegate type:kotlin.Lazy> visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.simple$rpcMethod declared in .BoxService.$rpcServiceStub.simple$rpcMethod' type=.BoxService.$rpcServiceStub.simple$rpcMethod origin=null + value: CALL 'public final fun lazy (mode: kotlin.LazyThreadSafetyMode, initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy> origin=null + : kotlinx.serialization.KSerializer + mode: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PUBLICATION' type=kotlin.LazyThreadSafetyMode + initializer: FUN_EXPR type=kotlin.Function0> origin=LAMBDA + FUN KOTLINX_SERIALIZATION name: visibility:local modality:FINAL <> () returnType:kotlinx.serialization.KSerializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlinx.serialization.KSerializer declared in .BoxService.$rpcServiceStub.simple$rpcMethod' + CONSTRUCTOR_CALL 'internal constructor (serialName: kotlin.String, objectInstance: T of kotlinx.serialization.internal.ObjectSerializer, classAnnotations: kotlin.Array) declared in kotlinx.serialization.internal.ObjectSerializer' type=kotlinx.serialization.internal.ObjectSerializer<.BoxService.$rpcServiceStub.simple$rpcMethod> origin=null + : + serialName: CONST String type=kotlin.String value="BoxService.$rpcServiceStub.simple$rpcMethod" + objectInstance: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments]' type=.BoxService.$rpcServiceStub.simple$rpcMethod + classAnnotations: CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Annotation + elements: VARARG type=kotlin.Array varargElementType=kotlin.Annotation + PROPERTY KOTLINX_SERIALIZATION name:$cachedSerializer visibility:private modality:FINAL [val] + FIELD KOTLINX_SERIALIZATION name:$cachedSerializer$delegate type:kotlin.Lazy> visibility:private [final] + FUN KOTLINX_SERIALIZATION name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.simple$rpcMethod) returnType:kotlinx.serialization.KSerializer + correspondingProperty: PROPERTY KOTLINX_SERIALIZATION name:$cachedSerializer visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.simple$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlinx.serialization.KSerializer declared in .BoxService.$rpcServiceStub.simple$rpcMethod' + CALL 'public abstract fun (): T of kotlin.Lazy declared in kotlin.Lazy' type=kotlinx.serialization.KSerializer origin=null + $this: GET_FIELD 'FIELD KOTLINX_SERIALIZATION name:$cachedSerializer$delegate type:kotlin.Lazy> visibility:private [final]' type=kotlin.Lazy> origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.simple$rpcMethod declared in .BoxService.$rpcServiceStub.simple$rpcMethod.' type=.BoxService.$rpcServiceStub.simple$rpcMethod origin=null + CONSTRUCTOR GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] visibility:private <> () returnType:.BoxService.$rpcServiceStub.simple$rpcMethod [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serializer visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.simple$rpcMethod) returnType:kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.simple$rpcMethod> + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.simple$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun serializer (): kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.simple$rpcMethod> declared in .BoxService.$rpcServiceStub.simple$rpcMethod' + CALL 'private final fun (): kotlinx.serialization.KSerializer declared in .BoxService.$rpcServiceStub.simple$rpcMethod' type=kotlinx.serialization.KSerializer origin=null + $this: GET_VAR ': .BoxService.$rpcServiceStub.simple$rpcMethod declared in .BoxService.$rpcServiceStub.simple$rpcMethod.serializer' type=.BoxService.$rpcServiceStub.simple$rpcMethod origin=null + FUN name:asArray visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.simple$rpcMethod) returnType:kotlin.Array + overridden: + public abstract fun asArray (): kotlin.Array declared in kotlinx.rpc.internal.RPCMethodClassArguments + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.simple$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun asArray (): kotlin.Array declared in .BoxService.$rpcServiceStub.simple$rpcMethod' + CALL 'public final fun emptyArray (): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Any? + CONSTRUCTOR visibility:public <> (__rpc_stub_id:kotlin.Long, __rpc_client:kotlinx.rpc.RPCClient) returnType:.BoxService.$rpcServiceStub [primary] + VALUE_PARAMETER name:__rpc_stub_id index:0 type:kotlin.Long + VALUE_PARAMETER name:__rpc_client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:simple visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.String [suspend] + overridden: + public abstract fun simple (): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun simple (): kotlin.String declared in .BoxService.$rpcServiceStub' + CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + : kotlin.String + serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=kotlinx.coroutines.CoroutineScope origin=null + body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.simple' + CALL 'public abstract fun call (call: kotlinx.rpc.RPCCall): T of kotlinx.rpc.RPCClient.call declared in kotlinx.rpc.RPCClient' type=kotlin.String origin=null + : kotlin.String + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (serviceTypeString: kotlin.String, serviceId: kotlin.Long, callableName: kotlin.String, type: kotlinx.rpc.RPCCall.Type, data: kotlin.Any, dataType: kotlin.reflect.KType, returnType: kotlin.reflect.KType) declared in kotlinx.rpc.RPCCall' type=kotlinx.rpc.RPCCall origin=null + serviceTypeString: CONST String type=kotlin.String value="BoxService" + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null + callableName: CONST String type=kotlin.String value="simple" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:Method' type=kotlinx.rpc.RPCCall.Type + data: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments]' type=.BoxService.$rpcServiceStub.simple$rpcMethod + dataType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.simple$rpcMethod + returnType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:simple visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlin.String [suspend] + $this: VALUE_PARAMETER name: type:.BoxService + PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RPC) returnType:kotlin.coroutines.CoroutineContext [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlinx.rpc.RPC +Module: main +FILE fqName: fileName:/module_main_multiModule.kt + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun runBlocking (context: kotlin.coroutines.CoroutineContext, block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): T of kotlinx.coroutines.runBlocking declared in kotlinx.coroutines' type=kotlin.String origin=null + : kotlin.String + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlinx.coroutines.CoroutineScope) returnType:kotlin.String [suspend] + $receiver: VALUE_PARAMETER name:$this$runBlocking type:kotlinx.coroutines.CoroutineScope + BLOCK_BODY + VAR name:result type:kotlin.String [val] + CALL 'public abstract fun simple (): kotlin.String declared in .BoxService' type=kotlin.String origin=null + $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null + : .BoxService + $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RPCClient]' type=kotlinx.rpc.codegen.test.TestRpcClient + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val result: kotlin.String declared in .box.' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="call_42" + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Fail: " + GET_VAR 'val result: kotlin.String declared in .box.' type=kotlin.String origin=null diff --git a/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt new file mode 100644 index 00000000..28244d13 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt @@ -0,0 +1,38 @@ +Module: lib +FILE: module_lib_multiModule.kt + public abstract interface BoxService : R|kotlinx/rpc/RPC| { + public abstract suspend fun simple(): R|kotlin/String| + + public final class $rpcServiceStub : R|kotlin/Any| { + @R|kotlinx/serialization/Serializable|() public final object simple$rpcMethod : R|kotlin/Any| { + public final fun serializer(): R|kotlinx/serialization/KSerializer| + + private constructor(): R|BoxService.$rpcServiceStub.simple$rpcMethod| { + super() + } + + } + + public final companion object Companion : R|kotlin/Any| { + } + + } + + } +Module: main +FILE: module_main_multiModule.kt + public final fun box(): R|kotlin/String| { + ^box R|kotlinx/coroutines/runBlocking|( = runBlocking@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/String| { + lval result: R|kotlin/String| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.simple|() + ^ when () { + ==(R|/result|, String(call_42)) -> { + String(OK) + } + else -> { + (String(Fail: ), R|/result|) + } + } + + } + ) + } diff --git a/tests/compiler-plugin-tests/src/testData/box/multiModule.kt b/tests/compiler-plugin-tests/src/testData/box/multiModule.kt new file mode 100644 index 00000000..6d89cfb3 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/multiModule.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +// MODULE: lib + +import kotlinx.rpc.RPC + +interface BoxService : RPC { + suspend fun simple(): String +} + +// MODULE: main(lib) + +import kotlinx.coroutines.runBlocking +import kotlinx.rpc.RPC +import kotlinx.rpc.withService +import kotlinx.rpc.codegen.test.TestRpcClient + +fun box(): String = runBlocking { + val result = TestRpcClient.withService().simple() + + if (result == "call_42") "OK" else "Fail: $result" +} diff --git a/tests/compiler-plugin-tests/src/testData/box/simple.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/simple.fir.ir.txt new file mode 100644 index 00000000..6d681af7 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/simple.fir.ir.txt @@ -0,0 +1,276 @@ +FILE fqName: fileName:/simple.kt + CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RPC] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub + PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_stub_id: kotlin.Long declared in .BoxService.$rpcServiceStub.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.Long + correspondingProperty: PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final]' type=kotlin.Long origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final] + EXPRESSION_BODY + GET_VAR '__rpc_client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.' type=kotlinx.rpc.RPCClient origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.rpc.RPCClient + correspondingProperty: PROPERTY name:__rpc_client visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RPCClient visibility:private [final]' type=kotlinx.rpc.RPCClient origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] + EXPRESSION_BODY + CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPCClient' type=kotlin.coroutines.CoroutineContext origin=null + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext + correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null + CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion + PROPERTY name:methodNames visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun mapOf (vararg pairs: kotlin.Pair): kotlin.collections.Map declared in kotlin.collections' type=kotlin.collections.Map origin=null + : kotlin.String + : kotlin.reflect.KType + pairs: VARARG type=kotlin.Array> varargElementType=kotlin.Pair + CALL 'public final fun to (that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair origin=null + : kotlin.String + : kotlin.reflect.KType + $receiver: CONST String type=kotlin.String value="simple" + that: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.simple$rpcMethod + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlin.collections.Map + correspondingProperty: PROPERTY name:methodNames visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:methodNames type:kotlin.collections.Map visibility:private [final]' type=kotlin.collections.Map origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null + CONSTRUCTOR visibility:private <> () returnType:.BoxService.$rpcServiceStub.Companion [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.internal.RPCStubObject<.BoxService>]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:methodTypeOf visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, methodName:kotlin.String) returnType:kotlin.reflect.KType? + overridden: + public abstract fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:methodName index:0 type:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun methodTypeOf (methodName: kotlin.String): kotlin.reflect.KType? declared in .BoxService.$rpcServiceStub.Companion' + CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map' type=kotlin.reflect.KType? origin=GET_ARRAY_ELEMENT + $this: CALL 'private final fun (): kotlin.collections.Map declared in .BoxService.$rpcServiceStub.Companion' type=kotlin.collections.Map origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=.BoxService.$rpcServiceStub.Companion origin=null + key: GET_VAR 'methodName: kotlin.String declared in .BoxService.$rpcServiceStub.Companion.methodTypeOf' type=kotlin.String origin=null + FUN name:rpcFields visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, service:.BoxService) returnType:kotlin.collections.List> + overridden: + public abstract fun rpcFields (service: T of kotlinx.rpc.internal.RPCStubObject): kotlin.collections.List> declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:service index:0 type:.BoxService + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun rpcFields (service: .BoxService): kotlin.collections.List> declared in .BoxService.$rpcServiceStub.Companion' + TYPE_OP type=kotlin.collections.List> origin=CAST typeOperand=kotlin.collections.List> + CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : kotlin.Any? + FUN name:withClient visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, serviceId:kotlin.Long, client:kotlinx.rpc.RPCClient) returnType:.BoxService + overridden: + public abstract fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): T of kotlinx.rpc.internal.RPCStubObject declared in kotlinx.rpc.internal.RPCStubObject + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion + VALUE_PARAMETER name:serviceId index:0 type:kotlin.Long + VALUE_PARAMETER name:client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun withClient (serviceId: kotlin.Long, client: kotlinx.rpc.RPCClient): .BoxService declared in .BoxService.$rpcServiceStub.Companion' + CONSTRUCTOR_CALL 'public constructor (__rpc_stub_id: kotlin.Long, __rpc_client: kotlinx.rpc.RPCClient) declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null + __rpc_stub_id: GET_VAR 'serviceId: kotlin.Long declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlin.Long origin=null + __rpc_client: GET_VAR 'client: kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub.Companion.withClient' type=kotlinx.rpc.RPCClient origin=null + CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments] + annotations: + Serializable(with = ) + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.simple$rpcMethod + ANONYMOUS_INITIALIZER isStatic=false + BLOCK_BODY + SET_FIELD 'FIELD KOTLINX_SERIALIZATION name:$cachedSerializer$delegate type:kotlin.Lazy> visibility:private [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.simple$rpcMethod declared in .BoxService.$rpcServiceStub.simple$rpcMethod' type=.BoxService.$rpcServiceStub.simple$rpcMethod origin=null + value: CALL 'public final fun lazy (mode: kotlin.LazyThreadSafetyMode, initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy> origin=null + : kotlinx.serialization.KSerializer + mode: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PUBLICATION' type=kotlin.LazyThreadSafetyMode + initializer: FUN_EXPR type=kotlin.Function0> origin=LAMBDA + FUN KOTLINX_SERIALIZATION name: visibility:local modality:FINAL <> () returnType:kotlinx.serialization.KSerializer + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlinx.serialization.KSerializer declared in .BoxService.$rpcServiceStub.simple$rpcMethod' + CONSTRUCTOR_CALL 'internal constructor (serialName: kotlin.String, objectInstance: T of kotlinx.serialization.internal.ObjectSerializer, classAnnotations: kotlin.Array) declared in kotlinx.serialization.internal.ObjectSerializer' type=kotlinx.serialization.internal.ObjectSerializer<.BoxService.$rpcServiceStub.simple$rpcMethod> origin=null + : + serialName: CONST String type=kotlin.String value="BoxService.$rpcServiceStub.simple$rpcMethod" + objectInstance: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments]' type=.BoxService.$rpcServiceStub.simple$rpcMethod + classAnnotations: CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Annotation + elements: VARARG type=kotlin.Array varargElementType=kotlin.Annotation + PROPERTY KOTLINX_SERIALIZATION name:$cachedSerializer visibility:private modality:FINAL [val] + FIELD KOTLINX_SERIALIZATION name:$cachedSerializer$delegate type:kotlin.Lazy> visibility:private [final] + FUN KOTLINX_SERIALIZATION name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.simple$rpcMethod) returnType:kotlinx.serialization.KSerializer + correspondingProperty: PROPERTY KOTLINX_SERIALIZATION name:$cachedSerializer visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.simple$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlinx.serialization.KSerializer declared in .BoxService.$rpcServiceStub.simple$rpcMethod' + CALL 'public abstract fun (): T of kotlin.Lazy declared in kotlin.Lazy' type=kotlinx.serialization.KSerializer origin=null + $this: GET_FIELD 'FIELD KOTLINX_SERIALIZATION name:$cachedSerializer$delegate type:kotlin.Lazy> visibility:private [final]' type=kotlin.Lazy> origin=null + receiver: GET_VAR ': .BoxService.$rpcServiceStub.simple$rpcMethod declared in .BoxService.$rpcServiceStub.simple$rpcMethod.' type=.BoxService.$rpcServiceStub.simple$rpcMethod origin=null + CONSTRUCTOR GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] visibility:private <> () returnType:.BoxService.$rpcServiceStub.simple$rpcMethod [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:serializer visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.simple$rpcMethod) returnType:kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.simple$rpcMethod> + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.simple$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun serializer (): kotlinx.serialization.KSerializer<.BoxService.$rpcServiceStub.simple$rpcMethod> declared in .BoxService.$rpcServiceStub.simple$rpcMethod' + CALL 'private final fun (): kotlinx.serialization.KSerializer declared in .BoxService.$rpcServiceStub.simple$rpcMethod' type=kotlinx.serialization.KSerializer origin=null + $this: GET_VAR ': .BoxService.$rpcServiceStub.simple$rpcMethod declared in .BoxService.$rpcServiceStub.simple$rpcMethod.serializer' type=.BoxService.$rpcServiceStub.simple$rpcMethod origin=null + FUN name:asArray visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.simple$rpcMethod) returnType:kotlin.Array + overridden: + public abstract fun asArray (): kotlin.Array declared in kotlinx.rpc.internal.RPCMethodClassArguments + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.simple$rpcMethod + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun asArray (): kotlin.Array declared in .BoxService.$rpcServiceStub.simple$rpcMethod' + CALL 'public final fun emptyArray (): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Any? + CONSTRUCTOR visibility:public <> (__rpc_stub_id:kotlin.Long, __rpc_client:kotlinx.rpc.RPCClient) returnType:.BoxService.$rpcServiceStub [primary] + VALUE_PARAMETER name:__rpc_stub_id index:0 type:kotlin.Long + VALUE_PARAMETER name:__rpc_client index:1 type:kotlinx.rpc.RPCClient + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:simple visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.String [suspend] + overridden: + public abstract fun simple (): kotlin.String declared in .BoxService + $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun simple (): kotlin.String declared in .BoxService.$rpcServiceStub' + CALL 'public final fun scopedClientCall (serviceScope: kotlinx.coroutines.CoroutineScope, body: kotlin.coroutines.SuspendFunction0): T of kotlinx.rpc.internal.scopedClientCall declared in kotlinx.rpc.internal' type=kotlin.String origin=null + : kotlin.String + serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=kotlinx.coroutines.CoroutineScope origin=null + body: FUN_EXPR type=kotlin.coroutines.SuspendFunction0 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String [suspend] + BLOCK_BODY + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.simple' + CALL 'public abstract fun call (call: kotlinx.rpc.RPCCall): T of kotlinx.rpc.RPCClient.call declared in kotlinx.rpc.RPCClient' type=kotlin.String origin=null + : kotlin.String + $this: CALL 'private final fun (): kotlinx.rpc.RPCClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RPCClient origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null + call: CONSTRUCTOR_CALL 'public constructor (serviceTypeString: kotlin.String, serviceId: kotlin.Long, callableName: kotlin.String, type: kotlinx.rpc.RPCCall.Type, data: kotlin.Any, dataType: kotlin.reflect.KType, returnType: kotlin.reflect.KType) declared in kotlinx.rpc.RPCCall' type=kotlinx.rpc.RPCCall origin=null + serviceTypeString: CONST String type=kotlin.String value="BoxService" + serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY + $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.simple' type=.BoxService.$rpcServiceStub origin=null + callableName: CONST String type=kotlin.String value="simple" + type: GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:Method' type=kotlinx.rpc.RPCCall.Type + data: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RPCGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlinx.rpc.internal.RPCMethodClassArguments]' type=.BoxService.$rpcServiceStub.simple$rpcMethod + dataType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : .BoxService.$rpcServiceStub.simple$rpcMethod + returnType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null + : kotlin.String + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:simple visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlin.String [suspend] + $this: VALUE_PARAMETER name: type:.BoxService + PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract coroutineContext: kotlin.coroutines.CoroutineContext + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RPC) returnType:kotlin.coroutines.CoroutineContext [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RPC + $this: VALUE_PARAMETER name: type:kotlinx.rpc.RPC + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun runBlocking (context: kotlin.coroutines.CoroutineContext, block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): T of kotlinx.coroutines.runBlocking declared in kotlinx.coroutines' type=kotlin.String origin=null + : kotlin.String + block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlinx.coroutines.CoroutineScope) returnType:kotlin.String [suspend] + $receiver: VALUE_PARAMETER name:$this$runBlocking type:kotlinx.coroutines.CoroutineScope + BLOCK_BODY + VAR name:result type:kotlin.String [val] + CALL 'public abstract fun simple (): kotlin.String declared in .BoxService' type=kotlin.String origin=null + $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null + : .BoxService + $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RPCClient]' type=kotlinx.rpc.codegen.test.TestRpcClient + RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' + WHEN type=kotlin.String origin=IF + BRANCH + if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + arg0: GET_VAR 'val result: kotlin.String declared in .box.' type=kotlin.String origin=null + arg1: CONST String type=kotlin.String value="call_42" + then: CONST String type=kotlin.String value="OK" + BRANCH + if: CONST Boolean type=kotlin.Boolean value=true + then: STRING_CONCATENATION type=kotlin.String + CONST String type=kotlin.String value="Fail: " + GET_VAR 'val result: kotlin.String declared in .box.' type=kotlin.String origin=null diff --git a/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt b/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt new file mode 100644 index 00000000..44770b12 --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt @@ -0,0 +1,35 @@ +FILE: simple.kt + public abstract interface BoxService : R|kotlinx/rpc/RPC| { + public abstract suspend fun simple(): R|kotlin/String| + + public final class $rpcServiceStub : R|kotlin/Any| { + @R|kotlinx/serialization/Serializable|() public final object simple$rpcMethod : R|kotlin/Any| { + public final fun serializer(): R|kotlinx/serialization/KSerializer| + + private constructor(): R|BoxService.$rpcServiceStub.simple$rpcMethod| { + super() + } + + } + + public final companion object Companion : R|kotlin/Any| { + } + + } + + } + public final fun box(): R|kotlin/String| { + ^box R|kotlinx/coroutines/runBlocking|( = runBlocking@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/String| { + lval result: R|kotlin/String| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.simple|() + ^ when () { + ==(R|/result|, String(call_42)) -> { + String(OK) + } + else -> { + (String(Fail: ), R|/result|) + } + } + + } + ) + } diff --git a/tests/compiler-plugin-tests/src/testData/box/simple.kt b/tests/compiler-plugin-tests/src/testData/box/simple.kt new file mode 100644 index 00000000..67a2488c --- /dev/null +++ b/tests/compiler-plugin-tests/src/testData/box/simple.kt @@ -0,0 +1,18 @@ +/* + * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +import kotlinx.coroutines.runBlocking +import kotlinx.rpc.RPC +import kotlinx.rpc.withService +import kotlinx.rpc.codegen.test.TestRpcClient + +interface BoxService : RPC { + suspend fun simple(): String +} + +fun box(): String = runBlocking { + val result = TestRpcClient.withService().simple() + + if (result == "call_42") "OK" else "Fail: $result" +} diff --git a/updateTestData.sh b/updateTestData.sh new file mode 100755 index 00000000..6233f829 --- /dev/null +++ b/updateTestData.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# +# Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. +# + +if [ "$#" -ne 1 ] && [ "$#" -ne 2 ]; then + echo "Pass test name without the package and the 'Generated' suffix, for example:" >&2 + echo "" >&2 + echo "$0 BoxTest" >&2 + exit 1 +fi; + +if [ "$#" -eq 2 ]; then + TEST_NAME=".$2" +else + TEST_NAME="" +fi; + +set -o xtrace + +./gradlew \ + :tests:compiler-plugin-tests:test \ + --tests "kotlinx.rpc.codegen.test.runners.$1Generated$TEST_NAME" \ + --continue \ + -Pkotlin.test.update.test.data=true diff --git a/versions-root/libs.versions.toml b/versions-root/libs.versions.toml index ba2bda11..2cc1a041 100644 --- a/versions-root/libs.versions.toml +++ b/versions-root/libs.versions.toml @@ -14,8 +14,11 @@ slf4j = "2.0.13" logback = "1.3.14" gradle-plugin-publish = "1.2.1" kotlin-wrappers = "1.0.0-pre.781" +junit4 = "4.13.2" +junit5 = "5.10.3" +intellij = "213.7172.53" -# stub versions - relpaced based on kotlin, mostly for gradle-related (plugins) dependencies +# stub versions – relpaced based on kotlin, mostly for gradle-related (plugins) dependencies # but also for dependencies for compiler specific modules ksp = "" atomicfu = "" @@ -26,6 +29,10 @@ binary-compatibility-validator = "" kover = "" [libraries] +# kotlinx.rpc – references to the included builds +# as they're local to the project, kotlinx-rpc- prefix is omitted +compiler-plugin-cli = { module = "org.jetbrains.kotlinx:compiler-plugin-cli" } + # kotlin kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin-lang" } kotlin-stdlib-jdk7 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk7", version.ref = "kotlin-lang" } @@ -33,9 +40,13 @@ kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", versi kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin-lang" } kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-lang" } kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin-lang" } +kotlin-script-runtime = { module = "org.jetbrains.kotlin:kotlin-script-runtime", version.ref = "kotlin-lang" } +kotlin-annotations-jvm = { module = "org.jetbrains.kotlin:kotlin-annotations-jvm", version.ref = "kotlin-lang" } kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin-lang" } -kotlin-compiler-embeddable = { group = "org.jetbrains.kotlin", name = "kotlin-compiler-embeddable" } +kotlin-compiler = { module = "org.jetbrains.kotlin:kotlin-compiler", version.ref = "kotlin-lang" } +kotlin-compiler-embeddable = { module = "org.jetbrains.kotlin:kotlin-compiler-embeddable" } +kotlin-compiler-test-framework = { module = "org.jetbrains.kotlin:kotlin-compiler-internal-test-framework", version.ref = "kotlin-lang" } serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization-compiler-plugin", version.ref = "kotlin-lang" } # serialization @@ -62,6 +73,15 @@ ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.re slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" } logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } +# junit +junit4 = { module = "junit:junit", version.ref = "junit4" } +junit5-bom = { module = "org.junit:junit-bom", version.ref = "junit5" } +junit5-jupiter = { module = "org.junit.jupiter:junit-jupiter" } +junit5-platform-commons = { module = "org.junit.platform:junit-platform-commons" } +junit5-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" } +junit5-platform-runner = { module = "org.junit.platform:junit-platform-runner" } +junit5-platform-suite-api = { module = "org.junit.platform:junit-platform-suite-api" } + # other kotlin-logging = { module = "io.github.oshai:kotlin-logging", version.ref = "kotlin-logging" } kotlin-logging-legacy = { module = "io.github.microutils:kotlin-logging", version.ref = "kotlin-logging" } @@ -72,6 +92,7 @@ detekt-gradle-plugin = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plu kover-gradle-plugin = { module = "org.jetbrains.kotlinx:kover-gradle-plugin", version.ref = "kover" } kotlin-js-wrappers = { module = "org.jetbrains.kotlin-wrappers:kotlin-js", version.ref = "kotlin-wrappers" } gradle-kotlin-dsl-pluigns = { module = "org.gradle.kotlin:gradle-kotlin-dsl-plugins", version.ref = "gradle-kotlin-dsl" } +intellij-util = { module = "com.jetbrains.intellij.platform:util", version.ref = "intellij" } [plugins] kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-lang" }