From 4126e09d38fad876531224556cda6abf84409ecd Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Fri, 13 Jun 2025 17:01:43 +0200 Subject: [PATCH 1/4] KRPC-165 kotlinx.serialization decoupling in compiler plugin --- .../rpc/codegen/extension/RpcIrContext.kt | 61 +- .../rpc/codegen/extension/RpcStubGenerator.kt | 580 ++++++++---------- .../core/kotlinx/rpc/codegen/common/Names.kt | 7 +- .../compiler-plugin-k2/build.gradle.kts | 8 - .../kotlinx/rpc/codegen/FirGenerationKeys.kt | 21 - .../rpc/codegen/FirRpcAdditionalCheckers.kt | 3 - .../rpc/codegen/FirRpcExtensionRegistrar.kt | 20 +- .../rpc/codegen/FirRpcServiceGenerator.kt | 315 +--------- .../core/kotlinx/rpc/codegen/FirRpcUtils.kt | 1 + .../checkers/FirRpcAnnotationChecker.kt | 15 - .../rpc/codegen/checkers/FirRpcCheckers.kt | 4 +- .../checkers/FirRpcStrictModeClassChecker.kt | 7 +- .../checkers/SerializableProperties.kt | 116 ++++ .../checkers/diagnostics/FirRpcDiagnostics.kt | 1 - .../RpcDiagnosticRendererFactory.kt | 7 - ...erializationFirResolveExtensionDelegate.kt | 31 - .../rpc/codegen/serialization/annotation.kt | 47 -- .../rpc/codegen/checkers/FirRpcCheckersVS.kt | 4 +- .../rpc/codegen/checkers/FirRpcCheckersVS.kt | 4 +- .../rpc/codegen/checkers/FirRpcCheckersVS.kt | 4 +- .../rpc/codegen/checkers/FirRpcCheckersVS.kt | 4 +- .../rpc/codegen/checkers/FirRpcCheckersVS.kt | 4 +- core/build.gradle.kts | 3 +- .../commonMain/kotlin/kotlinx/rpc/RpcCall.kt | 12 +- .../rpc/descriptor/RpcServiceDescriptor.kt | 40 +- .../descriptor/RpcServiceDescriptorDefault.kt | 35 ++ .../descriptor/RpcServiceDescriptorKrpc.kt | 31 + .../kotlinx/rpc/internal/RpcMethodClass.kt | 12 - .../rpc/internal/rpcInternalDataCast.kt | 17 - .../kotlinx/rpc/krpc/client/KrpcClient.kt | 9 +- .../rpc/krpc/internal/CancellationType.kt | 1 - .../kotlinx/rpc/krpc/internal/KrpcPlugin.kt | 2 - .../rpc/krpc/internal/KrpcPluginKey.kt | 2 - .../RpcInternalShortEnumKSerializer.kt | 3 +- .../rpc/krpc/internal/SerializationUtils.kt | 107 +++- .../krpc/server/internal/KrpcServerService.kt | 15 +- .../kotlinx/rpc/krpc/test/KrpcTestService.kt | 7 +- .../rpc/krpc/test/KrpcTestServiceBackend.kt | 4 +- .../rpc/krpc/test/KrpcTransportTestBase.kt | 2 +- .../rpc/krpc/test/api/IndexedEnumTest.kt | 2 +- tests/compiler-plugin-tests/build.gradle.kts | 10 - .../ExtensionRegistrarConfigurator.kt | 4 - utils/build.gradle.kts | 1 - .../utils/map/RpcInternalConcurrentHashMap.kt | 2 +- .../internal/utils/map/SynchronizedHashMap.kt | 2 +- .../utils/map/ConcurrentHashMap.jvm.kt | 4 +- 46 files changed, 670 insertions(+), 921 deletions(-) create mode 100644 compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/SerializableProperties.kt delete mode 100644 compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/serialization/SerializationFirResolveExtensionDelegate.kt delete mode 100644 compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/serialization/annotation.kt create mode 100644 core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptorDefault.kt create mode 100644 core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptorKrpc.kt delete mode 100644 core/src/commonMain/kotlin/kotlinx/rpc/internal/RpcMethodClass.kt delete mode 100644 core/src/commonMain/kotlin/kotlinx/rpc/internal/rpcInternalDataCast.kt rename {utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils => krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal}/RpcInternalShortEnumKSerializer.kt (95%) diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcIrContext.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcIrContext.kt index 2c16f608c..4a629e10b 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcIrContext.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcIrContext.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.types.makeNullable +import org.jetbrains.kotlin.ir.types.typeWith import org.jetbrains.kotlin.ir.util.functions import org.jetbrains.kotlin.ir.util.isVararg import org.jetbrains.kotlin.ir.util.nestedClasses @@ -32,6 +33,14 @@ internal class RpcIrContext( irBuiltIns.arrayClass.typeWith(anyNullable, Variance.OUT_VARIANCE) } + val listOfAnnotations by lazy { + irBuiltIns.listClass.typeWith(irBuiltIns.annotationType) + } + + val arrayOfAnnotations by lazy { + irBuiltIns.arrayClass.typeWith(irBuiltIns.annotationType, Variance.OUT_VARIANCE) + } + val kTypeClass by lazy { getIrClassSymbol("kotlin.reflect", "KType") } @@ -68,10 +77,22 @@ internal class RpcIrContext( getRpcIrClassSymbol("RpcType", "descriptor") } + val rpcTypeDefault by lazy { + getRpcIrClassSymbol("RpcTypeDefault", "descriptor") + } + + val rpcTypeKrpc by lazy { + getRpcIrClassSymbol("RpcTypeKrpc", "descriptor") + } + val rpcCallable by lazy { getRpcIrClassSymbol("RpcCallable", "descriptor") } + val rpcCallableDefault by lazy { + getRpcIrClassSymbol("RpcCallableDefault", "descriptor") + } + private val rpcInvokator by lazy { getRpcIrClassSymbol("RpcInvokator", "descriptor") } @@ -84,8 +105,20 @@ internal class RpcIrContext( getRpcIrClassSymbol("RpcParameter", "descriptor") } - val rpcMethodClass by lazy { - getRpcIrClassSymbol("RpcMethodClass", "internal") + val rpcParameterDefault by lazy { + getRpcIrClassSymbol("RpcParameterDefault", "descriptor") + } + + val kSerializer by lazy { + getIrClassSymbol("kotlinx.serialization", "KSerializer") + } + + val kSerializerAnyNullable by lazy { + kSerializer.typeWith(anyNullable) + } + + val kSerializerAnyNullableKClass by lazy { + irBuiltIns.kClassClass.typeWith(kSerializerAnyNullable) } fun isJsTarget(): Boolean { @@ -103,10 +136,6 @@ internal class RpcIrContext( val functions = Functions() inner class Functions { - val dataCast by lazy { - namedFunction("kotlinx.rpc.internal", "rpcInternalDataCast") - } - val rpcClientCall by lazy { rpcClient.namedFunction("call") } @@ -115,10 +144,6 @@ internal class RpcIrContext( rpcClient.namedFunction("callServerStreaming") } - val asArray by lazy { - rpcMethodClass.namedFunction("asArray") - } - val typeOf by lazy { namedFunction("kotlin.reflect", "typeOf") } @@ -135,10 +160,26 @@ internal class RpcIrContext( } } + val emptyList by lazy { + namedFunction("kotlin.collections", "emptyList") + } + + val listOf by lazy { + namedFunction("kotlin.collections", "listOf") { + vsApi { + it.owner.valueParametersVS().singleOrNull()?.isVararg ?: false + } + } + } + val mapGet by lazy { irBuiltIns.mapClass.namedFunction("get") } + val arrayGet by lazy { + irBuiltIns.arrayClass.namedFunction("get") + } + val emptyMap by lazy { namedFunction("kotlin.collections", "emptyMap") } 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 61a8c07a5..b5fce6706 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,7 +5,7 @@ package kotlinx.rpc.codegen.extension import kotlinx.rpc.codegen.VersionSpecificApi -import kotlinx.rpc.codegen.common.rpcMethodClassName +import kotlinx.rpc.codegen.common.RpcClassId import org.jetbrains.kotlin.backend.common.lower.DeclarationIrBuilder import org.jetbrains.kotlin.backend.jvm.functionByName import org.jetbrains.kotlin.cli.common.messages.MessageCollector @@ -22,6 +22,7 @@ import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrSymbol import org.jetbrains.kotlin.ir.symbols.IrValueSymbol import org.jetbrains.kotlin.ir.types.* +import org.jetbrains.kotlin.ir.util.isNullable import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames @@ -194,8 +195,6 @@ internal class RpcStubGenerator( } } - private val methodClasses = mutableListOf() - /** * RPC Methods generation * @@ -225,11 +224,6 @@ internal class RpcStubGenerator( "detekt.LongMethod", ) private fun IrClass.generateRpcMethod(method: ServiceDeclaration.Method) { - val isMethodObject = method.arguments.isEmpty() - - val methodClassName = method.function.name.rpcMethodClassName - val methodClass: IrClass = initiateAndGetMethodClass(methodClassName, method) - addFunction { name = method.function.name visibility = method.function.visibility @@ -261,8 +255,6 @@ internal class RpcStubGenerator( irRpcMethodClientCall( method = method, functionThisReceiver = functionThisReceiver, - isMethodObject = isMethodObject, - methodClass = methodClass, arguments = arguments, ) ) @@ -273,8 +265,6 @@ internal class RpcStubGenerator( val call = irRpcMethodClientCall( method = method, functionThisReceiver = functionThisReceiver, - isMethodObject = isMethodObject, - methodClass = methodClass, arguments = arguments, ) @@ -287,138 +277,6 @@ internal class RpcStubGenerator( } } - /** - * Frontend plugins generate the following: - * ```kotlin - * // Given rpc method: - * suspend fun hello(arg1: String, arg2: Int) - * - * // Frontend generates: - * @Serializable - * class hello$rpcMethod { - * constructor(arg1: String, arg2: String) - * - * val arg1: String - * val arg2: Int - * } - * ``` - * - * This method generates missing getters and backing fields' values. - * And adds RpcMethodClassArguments supertype with `asArray` method implemented. - * - * Resulting class: - * ```kotlin - * @Serializable - * class hello$rpcMethod( - * val arg1: String, - * val arg2: Int, - * ) : RpcMethodClassArguments { - * // or emptyArray when no arguments - * override fun asArray(): Array = arrayOf(arg1, arg2) - * } - * ``` - */ - private fun IrClass.initiateAndGetMethodClass(methodClassName: Name, method: ServiceDeclaration.Method): IrClass { - val methodClass = findDeclaration { it.name == methodClassName } - ?: error( - "Expected $methodClassName class to be present in stub class " + - "${declaration.service.name}${stubClass.name}" - ) - - methodClasses.add(methodClass) - - val methodClassThisReceiver = methodClass.thisReceiver - ?: error("Expected ${methodClass.name} of ${stubClass.name} to have a thisReceiver") - - val properties = if (methodClass.isClass) { - val argNames = method.arguments.memoryOptimizedMap { it.value.name }.toSet() - - // remove frontend generated properties - // new ones will be used instead - methodClass.declarations.removeAll { it is IrProperty && it.name in argNames } - - // primary constructor, serialization may add another - val constructor = methodClass.constructors.single { - vsApi { - method.arguments.size == it.valueParametersVS().size - } - } - - vsApi { constructor.isPrimaryVS = true } - methodClass.addDefaultConstructor(constructor) - - vsApi { constructor.valueParametersVS() }.memoryOptimizedMap { valueParam -> - methodClass.addConstructorProperty( - propertyName = valueParam.name, - propertyType = valueParam.type, - valueParameter = valueParam, - propertyVisibility = DescriptorVisibilities.PUBLIC, - ) - } - } else { - emptyList() - } - - methodClass.superTypes += ctx.rpcMethodClass.defaultType - - methodClass.addFunction { - name = ctx.functions.asArray.name - visibility = DescriptorVisibilities.PUBLIC - returnType = ctx.arrayOfAnyNullable - modality = Modality.OPEN - }.apply { - overriddenSymbols = listOf(ctx.functions.asArray.symbol) - - val asArrayThisReceiver = vsApi { - methodClassThisReceiver.copyToVS(this@apply, origin = IrDeclarationOrigin.DEFINED) - }.also { - vsApi { - dispatchReceiverParameterVS = it - } - } - - body = irBuilder(symbol).irBlockBody { - val callee = if (methodClass.isObject) { - ctx.functions.emptyArray - } else { - ctx.irBuiltIns.arrayOf - } - - val arrayOfCall = irCall(callee, type = ctx.arrayOfAnyNullable).apply arrayOfCall@{ - if (methodClass.isObject) { - arguments { - types { +ctx.anyNullable } - } - - return@arrayOfCall - } - - val vararg = irVararg( - elementType = ctx.anyNullable, - values = properties.memoryOptimizedMap { property -> - irCallProperty(methodClass, property, symbol = asArrayThisReceiver.symbol) - }, - ) - - arguments { - types { - +ctx.anyNullable - } - - values { - +vararg - } - } - - } - - +irReturn(arrayOfCall) - } - } - - return methodClass - } - /** * Part of [generateRpcMethod] that generates next call: * @@ -426,7 +284,7 @@ internal class RpcStubGenerator( * __rpc_client.call(RpcCall( * descriptor = Companion, * callableName = "", - * data = (()|), + * parameters = arrayOf(, ...), * serviceId = __rpc_stub_id, * )) * ``` @@ -435,18 +293,16 @@ internal class RpcStubGenerator( private fun IrBlockBodyBuilder.irRpcMethodClientCall( method: ServiceDeclaration.Method, functionThisReceiver: IrValueParameter, - isMethodObject: Boolean, - methodClass: IrClass, arguments: List, ): IrCall { - val callee = if (method.function.isNonSuspendingWithFlowReturn()) { + val clientCallee = if (method.function.isNonSuspendingWithFlowReturn()) { ctx.functions.rpcClientCallServerStreaming.symbol } else { ctx.functions.rpcClientCall.symbol } val call = irCall( - callee = callee, + callee = clientCallee, type = method.function.returnType, typeArgumentsCount = 1, ).apply { @@ -454,24 +310,35 @@ internal class RpcStubGenerator( callee = ctx.rpcCall.constructors.single(), typeArguments = emptyList(), ).apply { - val dataParameter = if (isMethodObject) { - irGetObject(methodClass.symbol) + val callee = if (arguments.isEmpty()) { + ctx.functions.emptyArray } else { - irCallConstructor( - // serialization plugin adds additional constructor with more arguments - callee = methodClass.constructors.single { - vsApi { - it.valueParametersVS().size == method.arguments.size - } - }.symbol, - typeArguments = emptyList(), - ).apply { + ctx.irBuiltIns.arrayOf + } + + val parametersParameter = irCall(callee, type = ctx.arrayOfAnyNullable).apply arrayOfCall@{ + if (arguments.isEmpty()) { arguments { - values { - arguments.forEach { valueParameter -> - +irGet(valueParameter) - } - } + types { +ctx.anyNullable } + } + + return@arrayOfCall + } + + val vararg = irVararg( + elementType = ctx.anyNullable, + values = arguments.memoryOptimizedMap { valueParameter -> + irGet(valueParameter) + }, + ) + + arguments { + types { + +ctx.anyNullable + } + + values { + +vararg } } } @@ -482,7 +349,7 @@ internal class RpcStubGenerator( +stringConst(method.function.name.asString()) - +dataParameter + +parametersParameter +irCallProperty( clazz = stubClass, @@ -651,8 +518,8 @@ internal class RpcStubGenerator( private val invokators = mutableMapOf() private fun IrClass.generateInvokators() { - declaration.methods.forEachIndexed { i, callable -> - generateInvokator(i, callable) + declaration.methods.forEach { callable -> + generateInvokator(callable) } } @@ -662,38 +529,23 @@ internal class RpcStubGenerator( * For methods: * ```kotlin * private val Invokator = RpcInvokator.Method { - * service: MyService, data: Any? -> + * service: MyService, parameters: Array -> * - * val dataCasted = data.dataCast<>( - * "", - * "", - * ) - * - * service.(dataCasted., ..., $completion) + * service.(parameters[0] as , ..., $completion) * } * ``` * * Where: * - `` - the name of the method - * - `` - type of the corresponding method class - * - `` - name of the service + * - - type of the kth parameter * - `$completion` - Continuation parameter - * - * For fields: - * ```kotlin - * private val Invokator = RpcInvokator.Field { service: MyService -> - * service. - * } - * ``` - * Where: - * - `` - the name of the field */ @Suppress( "detekt.NestedBlockDepth", "detekt.LongMethod", "detekt.CyclomaticComplexMethod", ) - private fun IrClass.generateInvokator(i: Int, callable: ServiceDeclaration.Callable) { + private fun IrClass.generateInvokator(callable: ServiceDeclaration.Callable) { invokators[callable.name] = addProperty { name = Name.identifier("${callable.name}Invokator") visibility = DescriptorVisibilities.PRIVATE @@ -722,51 +574,39 @@ internal class RpcStubGenerator( type = declaration.serviceType } - val dataParameter = if (callable is ServiceDeclaration.Method) { - addValueParameter { - name = Name.identifier("data") - type = ctx.anyNullable + val parametersParameter = when (callable) { + is ServiceDeclaration.Method -> addValueParameter { + name = Name.identifier("parameters") + type = ctx.arrayOfAnyNullable } - } else { - null } body = irBuilder(symbol).irBlockBody { - val call = when (callable) { - is ServiceDeclaration.Method -> { - val methodClass = methodClasses[i] - val dataCasted = irTemporary( - value = irCall(ctx.functions.dataCast, type = methodClass.defaultType).apply { - dataParameter ?: error("unreachable") - - arguments { - extensionReceiver = irGet(dataParameter) - - types { - +methodClass.defaultType - } + val call = irCall(callable.function).apply { + arguments { + dispatchReceiver = irGet(serviceParameter) - values { - +stringConst(callable.name) - +stringConst(declaration.fqName) + values { + callable.arguments.forEachIndexed { argIndex, arg -> + val parameter = irCall( + callee = ctx.functions.arrayGet.symbol, + type = ctx.anyNullable, + ).apply { + vsApi { originVS = IrStatementOrigin.GET_ARRAY_ELEMENT } + + arguments { + dispatchReceiver = irGet(parametersParameter) + + values { + +intConst(argIndex) + } } } - }, - nameHint = "dataCasted", - irType = methodClass.defaultType, - ) - - irCall(callable.function).apply { - arguments { - dispatchReceiver = irGet(serviceParameter) - - values { - callable.arguments.forEach { arg -> - +irCallProperty( - receiver = irGet(dataCasted), - property = methodClass.properties.single { it.name == arg.value.name }, - ) - } + + if (arg.type.isNullable()) { + +irSafeAs(parameter, arg.type) + } else { + +irAs(parameter, arg.type) } } } @@ -848,76 +688,14 @@ internal class RpcStubGenerator( val isEmpty = declaration.methods.isEmpty() initializer = factory.createExpressionBody( - vsApi { - IrCallImplVS( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = mapType, - symbol = if (isEmpty) ctx.functions.emptyMap else ctx.functions.mapOf, - valueArgumentsCount = if (isEmpty) 0 else 1, - typeArgumentsCount = 2, - ) - }.apply mapApply@{ - if (isEmpty) { - arguments { - types { - +ctx.irBuiltIns.stringType - +rpcCallableType - } - } - - return@mapApply - } - - val pairType = ctx.pair.typeWith(ctx.irBuiltIns.stringType, rpcCallableType) - - val varargType = ctx.irBuiltIns.arrayClass.typeWith(pairType, Variance.OUT_VARIANCE) - - val callables = declaration.methods - - val vararg = IrVarargImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = varargType, - varargElementType = pairType, - elements = callables.memoryOptimizedMapIndexed { i, callable -> - vsApi { - IrCallImplVS( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = pairType, - symbol = ctx.functions.to, - typeArgumentsCount = 2, - valueArgumentsCount = 1, - ) - }.apply { - arguments { - types { - +ctx.irBuiltIns.stringType - +rpcCallableType - } - - extensionReceiver = stringConst(callable.name) - - values { - +irRpcCallable(i, callable) - } - } - } - }, - ) - - arguments { - types { - +ctx.irBuiltIns.stringType - +rpcCallableType - } - - values { - +vararg - } - } - } + irMapOf( + keyType = ctx.irBuiltIns.stringType, + valueType = rpcCallableType, + elements = declaration.methods.map { callable -> + stringConst(callable.name) to irRpcCallable(callable) + }, + isEmpty = isEmpty, + ) ) } @@ -939,7 +717,8 @@ internal class RpcStubGenerator( * parameters = arrayOf( // or emptyArray() * RpcParameter( * "", - * RpcCall(typeOf<>()) + * RpcCall(typeOf<>(), .annotations), + * , * ), * ... * ), @@ -956,13 +735,13 @@ internal class RpcStubGenerator( * - `` - if a method, its k-th parameter name * - `` - if a method, its k-th parameter type */ - private fun irRpcCallable(i: Int, callable: ServiceDeclaration.Callable): IrExpression { + private fun irRpcCallable(callable: ServiceDeclaration.Callable): IrExpression { return vsApi { IrConstructorCallImplVS( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, type = ctx.rpcCallable.typeWith(declaration.serviceType), - symbol = ctx.rpcCallable.constructors.single(), + symbol = ctx.rpcCallableDefault.constructors.single(), typeArgumentsCount = 1, valueArgumentsCount = 5, constructorTypeArgumentsCount = 1, @@ -970,9 +749,7 @@ internal class RpcStubGenerator( }.apply { putConstructorTypeArgument(0, declaration.serviceType) - val dataType = when (callable) { - is ServiceDeclaration.Method -> methodClasses[i].defaultType - } + callable as ServiceDeclaration.Method val returnType = when { callable.function.isNonSuspendingWithFlowReturn() -> { @@ -1029,16 +806,17 @@ internal class RpcStubGenerator( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, type = ctx.rpcParameter.defaultType, - symbol = ctx.rpcParameter.constructors.single(), + symbol = ctx.rpcParameterDefault.constructors.single(), typeArgumentsCount = 0, constructorTypeArgumentsCount = 0, - valueArgumentsCount = 2, + valueArgumentsCount = 3, ) }.apply { arguments { values { +stringConst(parameter.value.name.asString()) +irRpcTypeCall(parameter.type) + +irListOfAnnotations(parameter.value) } } } @@ -1060,8 +838,6 @@ internal class RpcStubGenerator( values { +stringConst(callable.name) - +irRpcTypeCall(dataType) - +irRpcTypeCall(returnType) +irCallProperty(stubCompanionObject.owner, invokator) @@ -1074,6 +850,38 @@ internal class RpcStubGenerator( } } + private fun irListOfAnnotations(container: IrAnnotationContainer): IrCallImpl { + val isEmpty = container.annotations.isEmpty() + return vsApi { + IrCallImplVS( + startOffset = UNDEFINED_OFFSET, + endOffset = UNDEFINED_OFFSET, + symbol = if (isEmpty) ctx.functions.emptyList else ctx.functions.listOf, + type = ctx.listOfAnnotations, + typeArgumentsCount = 1, + valueArgumentsCount = if (isEmpty) 0 else 1, + ) + }.apply applyIrListOfAnnotations@{ + arguments { + types { +ctx.irBuiltIns.annotationType } + + if (isEmpty) { + return@applyIrListOfAnnotations + } + + values { + +IrVarargImpl( + startOffset = UNDEFINED_OFFSET, + endOffset = UNDEFINED_OFFSET, + type = ctx.arrayOfAnnotations, + varargElementType = ctx.irBuiltIns.annotationType, + elements = container.annotations, + ) + } + } + } + } + private fun IrSimpleFunction.isNonSuspendingWithFlowReturn(): Boolean { return returnType.classOrNull == ctx.flow && !isSuspend } @@ -1221,28 +1029,98 @@ internal class RpcStubGenerator( } /** - * IR call of the `RpcType(KType)` function + * IR call of the `RpcType(KType, List)` function */ private fun irRpcTypeCall(type: IrType): IrConstructorCallImpl { + // todo change to extension after KRPC-178 + val withSerializableAnnotations = type.annotations.any { + it.type.isSerializableAnnotation() + } + return vsApi { IrConstructorCallImplVS( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, type = ctx.rpcType.defaultType, - symbol = ctx.rpcType.constructors.single(), + symbol = (if (withSerializableAnnotations) ctx.rpcTypeKrpc else ctx.rpcTypeDefault) + .constructors.single(), typeArgumentsCount = 0, - valueArgumentsCount = 1, + valueArgumentsCount = if (withSerializableAnnotations) 3 else 2, constructorTypeArgumentsCount = 0, ) }.apply { arguments { values { +irTypeOfCall(type) + +irListOfAnnotations(type) + + if (withSerializableAnnotations) { + +irMapOf( + keyType = ctx.kSerializerAnyNullableKClass, + valueType = ctx.kSerializerAnyNullable, + elements = type.annotations + .filter { it.type.isSerializableAnnotation() } + .memoryOptimizedMap { + val kClassValue = it.arguments.singleOrNull() + as? IrClassReference + ?: error("Expected single not null value parameter of KSerializer::class for @Serializable annotation on type '${type.dumpKotlinLike()}'") + + kClassValue to kClassValue.classType.irCreateInstance() + } + ) + } + } + } + } + } + + private fun IrType.irCreateInstance(): IrExpression { + val classSymbol = + classOrNull ?: error("Expected class type for type to create instance '${type.dumpKotlinLike()}'") + + return if (classSymbol.owner.isObject) { + IrGetObjectValueImpl( + startOffset = UNDEFINED_OFFSET, + endOffset = UNDEFINED_OFFSET, + type = this, + symbol = classSymbol, + ) + } else { + val constructor = classSymbol.owner.primaryConstructor + ?: error("Expected primary constructor for a serializer '${dumpKotlinLike()}'") + + if (constructor.parameters.isNotEmpty()) { + error( + "Primary constructor for a serializer '${dumpKotlinLike()}' can't have parameters: " + + constructor.parameters.joinToString { it.dumpKotlinLike() } + ) + } + + vsApi { + IrConstructorCallImplVS( + startOffset = UNDEFINED_OFFSET, + endOffset = UNDEFINED_OFFSET, + type = ctx.rpcType.defaultType, + symbol = constructor.symbol, + typeArgumentsCount = constructor.typeParameters.size, + valueArgumentsCount = 0, + constructorTypeArgumentsCount = constructor.typeParameters.size, + ) + }.apply { + arguments { + types { + repeat(classSymbol.owner.typeParameters.size) { + +ctx.anyNullable + } + } } } } } + private fun IrType.isSerializableAnnotation(): Boolean = + classOrNull?.owner?.classId == RpcClassId.serializableAnnotation + /** * IR call of the `typeOf<...>()` function */ @@ -1276,6 +1154,82 @@ internal class RpcStubGenerator( } } + private fun irMapOf( + keyType: IrType, + valueType: IrType, + elements: List>, + isEmpty: Boolean = elements.isEmpty(), + ): IrCallImpl { + return vsApi { + IrCallImplVS( + startOffset = UNDEFINED_OFFSET, + endOffset = UNDEFINED_OFFSET, + type = ctx.irBuiltIns.mapClass.typeWith(keyType, valueType), + symbol = if (isEmpty) ctx.functions.emptyMap else ctx.functions.mapOf, + typeArgumentsCount = 2, + valueArgumentsCount = if (isEmpty) 0 else 1, + ) + }.apply mapApply@{ + if (isEmpty) { + arguments { + types { + +keyType + +valueType + } + } + + return@mapApply + } + + val pairType = ctx.pair.typeWith(keyType, valueType) + + val varargType = ctx.irBuiltIns.arrayClass.typeWith(pairType, Variance.OUT_VARIANCE) + + val vararg = IrVarargImpl( + startOffset = UNDEFINED_OFFSET, + endOffset = UNDEFINED_OFFSET, + type = varargType, + varargElementType = pairType, + elements = elements.memoryOptimizedMap { (key, value) -> + vsApi { + IrCallImplVS( + startOffset = UNDEFINED_OFFSET, + endOffset = UNDEFINED_OFFSET, + type = pairType, + symbol = ctx.functions.to, + typeArgumentsCount = 2, + valueArgumentsCount = 1, + ) + }.apply { + arguments { + types { + +keyType + +valueType + } + + extensionReceiver = key + + values { + +value + } + } + } + }, + ) + + arguments { + types { + +keyType + +valueType + } + + values { + +vararg + } + } + } + } + // adds fake overrides for toString(), equals(), hashCode() for a class private fun IrClass.addAnyOverrides(parent: IrClass? = null) { val anyClass = ctx.irBuiltIns.anyClass.owner @@ -1353,6 +1307,13 @@ internal class RpcStubGenerator( value = value, ) + private fun intConst(value: Int) = IrConstImpl.int( + startOffset = UNDEFINED_OFFSET, + endOffset = UNDEFINED_OFFSET, + type = ctx.irBuiltIns.intType, + value = value, + ) + private fun booleanConst(value: Boolean) = IrConstImpl.boolean( startOffset = UNDEFINED_OFFSET, endOffset = UNDEFINED_OFFSET, @@ -1367,4 +1328,7 @@ internal class RpcStubGenerator( private inline fun IrMemberAccessExpression<*>.arguments(body: IrMemberAccessExpressionBuilder.() -> Unit) { return arguments(ctx.versionSpecificApi, body) } + + fun IrBuilderWithScope.irSafeAs(argument: IrExpression, type: IrType) = + IrTypeOperatorCallImpl(startOffset, endOffset, type, IrTypeOperator.SAFE_CAST, type, argument) } diff --git a/compiler-plugin/compiler-plugin-common/src/main/core/kotlinx/rpc/codegen/common/Names.kt b/compiler-plugin/compiler-plugin-common/src/main/core/kotlinx/rpc/codegen/common/Names.kt index a60df0872..23523d760 100644 --- a/compiler-plugin/compiler-plugin-common/src/main/core/kotlinx/rpc/codegen/common/Names.kt +++ b/compiler-plugin/compiler-plugin-common/src/main/core/kotlinx/rpc/codegen/common/Names.kt @@ -13,7 +13,7 @@ object RpcClassId { val checkedTypeAnnotation = ClassId(FqName("kotlinx.rpc.annotations"), Name.identifier("CheckedTypeAnnotation")) val serializableAnnotation = ClassId(FqName("kotlinx.serialization"), Name.identifier("Serializable")) - val contextualAnnotation = ClassId(FqName("kotlinx.serialization"), Name.identifier("Contextual")) + val serializationTransient = ClassId.topLevel(FqName("kotlinx.serialization.Transient")) val flow = ClassId(FqName("kotlinx.coroutines.flow"), Name.identifier("Flow")) val sharedFlow = ClassId(FqName("kotlinx.coroutines.flow"), Name.identifier("SharedFlow")) @@ -22,9 +22,4 @@ object RpcClassId { object RpcNames { val SERVICE_STUB_NAME: Name = Name.identifier("\$rpcServiceStub") - - const val METHOD_CLASS_NAME_SUFFIX = "\$rpcMethod" } - -val Name.rpcMethodClassName: Name get() = Name.identifier("$identifier${RpcNames.METHOD_CLASS_NAME_SUFFIX}") -val Name.rpcMethodName: Name get() = Name.identifier(identifier.removeSuffix(RpcNames.METHOD_CLASS_NAME_SUFFIX)) diff --git a/compiler-plugin/compiler-plugin-k2/build.gradle.kts b/compiler-plugin/compiler-plugin-k2/build.gradle.kts index 2b0260fe7..2205f003b 100644 --- a/compiler-plugin/compiler-plugin-k2/build.gradle.kts +++ b/compiler-plugin/compiler-plugin-k2/build.gradle.kts @@ -77,13 +77,5 @@ kotlin { dependencies { compileOnly(libs.kotlin.compiler) - whenForIde { - compileOnly(libs.serialization.plugin.forIde) { - isTransitive = false - } - } otherwise { - compileOnly(libs.serialization.plugin) - } - implementation(projects.compilerPluginCommon) } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirGenerationKeys.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirGenerationKeys.kt index 6dd609833..0b0417ef8 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirGenerationKeys.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirGenerationKeys.kt @@ -7,14 +7,10 @@ package kotlinx.rpc.codegen import org.jetbrains.kotlin.GeneratedDeclarationKey import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey internal class RpcGeneratedStubKey( private val serviceName: Name, - val functions: List>, ) : GeneratedDeclarationKey() { override fun toString(): String { return "RpcGeneratedStubKey.$serviceName" @@ -24,25 +20,8 @@ internal class RpcGeneratedStubKey( internal val FirBasedSymbol<*>.generatedRpcServiceStubKey: RpcGeneratedStubKey? get() = (origin as? FirDeclarationOrigin.Plugin)?.key as? RpcGeneratedStubKey -internal class RpcGeneratedRpcMethodClassKey( - val rpcMethod: FirFunctionSymbol<*>, -) : GeneratedDeclarationKey() { - val isObject = rpcMethod.valueParameterSymbols.isEmpty() - - override fun toString(): String { - return "RpcGeneratedRpcMethodClassKey.${rpcMethod.name}" - } -} - -internal val FirBasedSymbol<*>.generatedRpcMethodClassKey: RpcGeneratedRpcMethodClassKey? get() = - (origin as? FirDeclarationOrigin.Plugin)?.key as? RpcGeneratedRpcMethodClassKey - internal object FirRpcServiceStubCompanionObject : GeneratedDeclarationKey() { override fun toString(): String { return "FirRpcServiceStubCompanionObject" } } - -internal val FirClassSymbol<*>.isFromSerializationPlugin: Boolean get() { - return (origin as? FirDeclarationOrigin.Plugin)?.key is SerializationPluginKey -} diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcAdditionalCheckers.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcAdditionalCheckers.kt index 806540499..8d701b0ca 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcAdditionalCheckers.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcAdditionalCheckers.kt @@ -19,7 +19,6 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol class FirRpcAdditionalCheckers( session: FirSession, - serializationIsPresent: Boolean, configuration: CompilerConfiguration, ) : FirAdditionalCheckersExtension(session) { override fun FirDeclarationPredicateRegistrar.registerPredicates() { @@ -29,7 +28,6 @@ class FirRpcAdditionalCheckers( private val ctx = FirCheckersContext( session = session, - serializationIsPresent = serializationIsPresent, annotationTypeSafetyEnabled = configuration.get(RpcFirConfigurationKeys.ANNOTATION_TYPE_SAFETY, true), ) @@ -39,7 +37,6 @@ class FirRpcAdditionalCheckers( class FirCheckersContext( private val session: FirSession, - val serializationIsPresent: Boolean, val annotationTypeSafetyEnabled: Boolean, ) { val typeParametersCache = session.firCachesFactory.createCache { typeParameter: FirTypeParameterSymbol -> diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcExtensionRegistrar.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcExtensionRegistrar.kt index 0502bf622..735154cb5 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcExtensionRegistrar.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcExtensionRegistrar.kt @@ -4,31 +4,21 @@ package kotlinx.rpc.codegen +import kotlinx.rpc.codegen.checkers.FirSerializablePropertiesProvider import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys -import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrar import org.jetbrains.kotlin.fir.analysis.extensions.FirAdditionalCheckersExtension.Factory as CFactory import org.jetbrains.kotlin.fir.extensions.FirDeclarationGenerationExtension.Factory as GFactory -import org.jetbrains.kotlin.fir.extensions.FirSupertypeGenerationExtension.Factory as SFactory +import org.jetbrains.kotlin.fir.extensions.FirExtensionSessionComponent.Factory as SCFactory class FirRpcExtensionRegistrar(private val configuration: CompilerConfiguration) : FirExtensionRegistrar() { override fun ExtensionRegistrarContext.configurePlugin() { val logger = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE) - val serializationIsPresent = try { - Class.forName("org.jetbrains.kotlinx.serialization.compiler.fir.SerializationFirResolveExtension") - +GFactory { FirRpcServiceGenerator(it, logger) } - true - } catch (_ : ClassNotFoundException) { - logger.report( - severity = CompilerMessageSeverity.INFO, - message = "Serialization plugin is not found, so generated services are not available", - ) - false - } - - +CFactory { FirRpcAdditionalCheckers(it, serializationIsPresent, configuration) } + +GFactory { FirRpcServiceGenerator(it, logger) } + +CFactory { FirRpcAdditionalCheckers(it, configuration) } + +SCFactory { FirSerializablePropertiesProvider(it) } } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcServiceGenerator.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcServiceGenerator.kt index 9d5300101..48cfbe8ba 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcServiceGenerator.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcServiceGenerator.kt @@ -4,73 +4,23 @@ package kotlinx.rpc.codegen -import kotlinx.rpc.codegen.common.RpcClassId import kotlinx.rpc.codegen.common.RpcNames -import kotlinx.rpc.codegen.common.rpcMethodClassName -import kotlinx.rpc.codegen.common.rpcMethodName -import kotlinx.rpc.codegen.serialization.addAnnotation -import kotlinx.rpc.codegen.serialization.generateCompanionDeclaration -import kotlinx.rpc.codegen.serialization.generateSerializerImplClass import org.jetbrains.kotlin.cli.common.messages.MessageCollector -import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.utils.isInterface -import org.jetbrains.kotlin.fir.declarations.utils.visibility import org.jetbrains.kotlin.fir.extensions.* -import org.jetbrains.kotlin.fir.moduleData import org.jetbrains.kotlin.fir.plugin.* import org.jetbrains.kotlin.fir.symbols.impl.* -import org.jetbrains.kotlin.fir.types.ConeKotlinType -import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef -import org.jetbrains.kotlin.fir.types.classId -import org.jetbrains.kotlin.fir.types.constructClassLikeType -import org.jetbrains.kotlin.name.CallableId -import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames -import org.jetbrains.kotlin.platform.isJs -import org.jetbrains.kotlin.platform.isWasm -import org.jetbrains.kotlin.platform.konan.isNative -import org.jetbrains.kotlinx.serialization.compiler.fir.SerializationFirResolveExtension -import org.jetbrains.kotlinx.serialization.compiler.fir.SerializationFirSupertypesExtension -import org.jetbrains.kotlinx.serialization.compiler.resolve.SerialEntityNames -import org.jetbrains.kotlinx.serialization.compiler.resolve.SerializationPackages -/** - * What is happening here: - * - * ## General idea - * - * Detect `@Rpc` annotation - generate stub classes. - * - * ## Usage of kotlinx.serialization plugin - * - * Here is one more tricky part. - * - * We generate classes that are marked `@Serializable`. - * In that case, the serialization plugin will not be able to pick up those classes and process them accordingly. - * - * That is why we have an instance of this plugin, which we call only on our generated classes - [serializationExtension] - * - * Not all the methods that we would like to call are public, so we access them via reflection: - * - [generateCompanionDeclaration] - * - [generateSerializerImplClass] - * - * This is basically copying the behavior of the actual plugin but isolated only for our generated classes. - */ class FirRpcServiceGenerator( session: FirSession, @Suppress("unused") private val logger: MessageCollector, ) : FirDeclarationGenerationExtension(session) { - private val serializationExtension by lazy { - SerializationFirResolveExtension(session) - } - - private val isJvmOrMetadata = !session.moduleData.platform.run { isJs() || isWasm() || isNative() } - override fun FirDeclarationPredicateRegistrar.registerPredicates() { register(FirRpcPredicates.rpc) } @@ -78,54 +28,27 @@ class FirRpcServiceGenerator( /** * Generates nested classifiers. * - * They can be of three kinds: + * They can be of two kinds: * - Nested Service Stub class. * In that case [classSymbol] will not have any RPC-generated [FirClassSymbol.origin]. * The only check we do - presence of the `@Rpc` annotation and return [RpcNames.SERVICE_STUB_NAME]. * - * - Companion object of the service stub and method classes. + * - Companion object of the service stub * If we generate this companion object, we will have [FirClassSymbol.origin] * of [classSymbol] be set to [RpcGeneratedStubKey], * because we're inside the previously generated service stub class. - * The same goes for method classes too. * So we return [SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT] * and a list of method class names. - * - * - Inside method classes. - * Method classes will too have their nested declarations. - * We detect them by using [RpcGeneratedRpcMethodClassKey]. - * Nested declarations for these classes are provided by the serialization plugin. - * These declarations can be of two types: serializable object and serializable classes. - * In the case of objects, - * the serialization plugin treats them like their own serializers, - * so no extra nested declarations are necessary. - * In the case of classes, serialization requires two additional nested declarations: - * [SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT] and [SerialEntityNames.SERIALIZER_CLASS_NAME]. */ override fun getNestedClassifiersNames( classSymbol: FirClassSymbol<*>, context: NestedClassGenerationContext, ): Set { val rpcServiceStubKey = classSymbol.generatedRpcServiceStubKey - val rpcMethodClassKey = classSymbol.generatedRpcMethodClassKey return when { - rpcMethodClassKey != null -> { - when { - !rpcMethodClassKey.isObject -> setOf( - SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT, - SerialEntityNames.SERIALIZER_CLASS_NAME, - ) - - // otherwise an object is generated instead of a class - // serialization plugin has other logic for such declarations - else -> emptySet() - } - } - rpcServiceStubKey != null -> { - rpcServiceStubKey.functions.map { it.name.rpcMethodClassName }.toSet() + - SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT + setOf(SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT) } classSymbol.isInterface && session.predicateBasedProvider.matches(FirRpcPredicates.rpc, classSymbol) -> { @@ -153,14 +76,6 @@ class FirRpcServiceGenerator( generateCompanionObjectForRpcServiceStub(owner) } - rpcServiceStubKey != null -> { - generateRpcMethodClass(owner, name, rpcServiceStubKey) - } - - owner.generatedRpcMethodClassKey != null -> { - generateNestedClassLikeDeclarationWithSerialization(owner, name) - } - name == RpcNames.SERVICE_STUB_NAME -> { generateRpcServiceStubClass(owner) } @@ -177,236 +92,14 @@ class FirRpcServiceGenerator( return createCompanionObject(owner, FirRpcServiceStubCompanionObject).symbol } - /** - * Generates method class for the respectful function. - * Class is marked `@Serializable` for the backend processing. - */ - private fun generateRpcMethodClass( - owner: FirClassSymbol<*>, - name: Name, - rpcServiceStubKey: RpcGeneratedStubKey, - ): FirClassLikeSymbol<*>? { - val methodName = name.rpcMethodName - val rpcMethod = rpcServiceStubKey.functions.singleOrNull { it.name == methodName } - ?: return null - val rpcMethodClassKey = RpcGeneratedRpcMethodClassKey(rpcMethod) - val classKind = if (rpcMethodClassKey.isObject) ClassKind.OBJECT else ClassKind.CLASS - - val rpcMethodClass = createNestedClass( - owner = owner, - name = name, - key = rpcMethodClassKey, - classKind = classKind, - ) { - visibility = owner.visibility - modality = Modality.FINAL - } - - rpcMethodClass.addAnnotation(RpcClassId.serializableAnnotation, session) - - /** - * Required to pass isSerializableObjectAndNeedsFactory check - * from [SerializationFirSupertypesExtension]. - */ - if (!isJvmOrMetadata && rpcMethodClassKey.isObject) { - rpcMethodClass.replaceSuperTypeRefs(createSerializationFactorySupertype()) - } - - return rpcMethodClass.symbol - } - - /** - * Instead of [SerializationFirSupertypesExtension] - * - * Also, it is not run for Companion objects, as [serializationExtension] does it when needed. - */ - private fun createSerializationFactorySupertype(): List { - val serializerFactoryClassId = ClassId( - SerializationPackages.internalPackageFqName, - SerialEntityNames.SERIALIZER_FACTORY_INTERFACE_NAME, - ) - - val ref = vsApi { - serializerFactoryClassId - .constructClassLikeType(emptyArray(), false) - .toFirResolvedTypeRefVS() - } - - return listOf(ref) - } - - /** - * Mirrors [generateNestedClassLikeDeclaration] from [serializationExtension]. - */ - private fun generateNestedClassLikeDeclarationWithSerialization( - owner: FirClassSymbol<*>, - name: Name, - ): FirClassLikeSymbol<*>? { - if (owner !is FirRegularClassSymbol) { - error("Expected ${owner.name} to be FirRegularClassSymbol") - } - - return when (name) { - SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT -> serializationExtension.generateCompanionDeclaration(owner) - SerialEntityNames.SERIALIZER_CLASS_NAME -> serializationExtension.generateSerializerImplClass(owner) - else -> error("Can't generate class ${owner.classId.createNestedClassId(name).asSingleFqName()}") - } - } - /** * Generates [owner]'s service stub. * Scrapes the functions from the [owner] to generate method classes. */ private fun generateRpcServiceStubClass(owner: FirClassSymbol<*>): FirRegularClassSymbol? { - val functions = vsApi { owner.declaredFunctionsVS(session) } - - return createNestedClass(owner, RpcNames.SERVICE_STUB_NAME, RpcGeneratedStubKey(owner.name, functions)) { + return createNestedClass(owner, RpcNames.SERVICE_STUB_NAME, RpcGeneratedStubKey(owner.name)) { visibility = Visibilities.Public modality = Modality.FINAL }.symbol } - - override fun getCallableNamesForClass(classSymbol: FirClassSymbol<*>, context: MemberGenerationContext): Set { - val rpcMethodClassKey = classSymbol.generatedRpcMethodClassKey - - return when { - rpcMethodClassKey != null -> { - getCallableNamesForRpcMethodClass(classSymbol, context, rpcMethodClassKey) - } - - classSymbol.isFromSerializationPlugin -> { - serializationExtension.getCallableNamesForClass(classSymbol, context) - } - - else -> { - emptySet() - } - } - } - - /** - * If the method doesn't have any parameters, it is an object, - * and its only callable names are constructor, and the ones provided by the [serializationExtension]. - * Otherwise, the callable names are the names of the method parameters and the constructor. - */ - private fun getCallableNamesForRpcMethodClass( - classSymbol: FirClassSymbol<*>, - context: MemberGenerationContext, - rpcMethodClassKey: RpcGeneratedRpcMethodClassKey, - ): Set { - return if (rpcMethodClassKey.isObject) { - // add .serializer() method for a serializable object - serializationExtension.getCallableNamesForClass(classSymbol, context) - } else { - rpcMethodClassKey.rpcMethod.valueParameterSymbols.map { it.name }.toSet() - } + SpecialNames.INIT - - // ^ init is necessary either way, as serialization doesn't add it for a serializable object - } - - override fun generateConstructors(context: MemberGenerationContext): List { - val rpcMethodClassKey = context.owner.generatedRpcMethodClassKey - return when { - rpcMethodClassKey != null -> generateConstructorsForRpcMethodClass(context, rpcMethodClassKey) - context.owner.isFromSerializationPlugin -> serializationExtension.generateConstructors(context) - else -> emptyList() - } - } - - /** - * An object needs only a default private constructor. - * - * A regular class constructor requires also value parameters of the respectful method. - */ - private fun generateConstructorsForRpcMethodClass( - context: MemberGenerationContext, - rpcMethodClassKey: RpcGeneratedRpcMethodClassKey, - ): List { - if (rpcMethodClassKey.isObject) { - return createDefaultPrivateConstructor(context.owner, rpcMethodClassKey).symbol.let(::listOf) - } - - return createConstructor(context.owner, rpcMethodClassKey) { - visibility = Visibilities.Public - - rpcMethodClassKey.rpcMethod.valueParameterSymbols.forEach { valueParam -> - valueParameter( - name = valueParam.name, - type = valueParam.resolvedReturnType, - ) - } - }.symbol.let(::listOf) - } - - override fun generateProperties( - callableId: CallableId, - context: MemberGenerationContext?, - ): List { - context ?: return emptyList() - - val owner = context.owner - val rpcMethodClassKey = owner.generatedRpcMethodClassKey - - return when { - rpcMethodClassKey != null -> { - generatePropertiesForRpcMethodClass(callableId, owner, rpcMethodClassKey) - } - - owner.isFromSerializationPlugin -> { - serializationExtension.generateProperties(callableId, context) - } - - else -> { - emptyList() - } - } - } - - private fun generatePropertiesForRpcMethodClass( - callableId: CallableId, - owner: FirClassSymbol<*>, - rpcMethodClassKey: RpcGeneratedRpcMethodClassKey, - ): List { - val valueParam = rpcMethodClassKey.rpcMethod.valueParameterSymbols.find { - it.name == callableId.callableName - } ?: return emptyList() - - return createMemberProperty( - owner = owner, - key = rpcMethodClassKey, - name = callableId.callableName, - returnType = valueParam.resolvedReturnType, - ).apply { - if (valueParam.resolvedReturnType.requiresContextual()) { - addAnnotation(RpcClassId.contextualAnnotation, session) - } - }.symbol.let(::listOf) - } - - private fun ConeKotlinType.requiresContextual(): Boolean { - return when (classId) { - RpcClassId.flow, RpcClassId.sharedFlow, RpcClassId.stateFlow -> true - else -> false - } - } - - /** - * Processes serialization related cases from [getCallableNamesForClass]. - */ - override fun generateFunctions( - callableId: CallableId, - context: MemberGenerationContext?, - ): List { - val owner = context?.owner ?: return emptyList() - - return when { - owner.isFromSerializationPlugin || owner.generatedRpcMethodClassKey?.isObject == true -> { - serializationExtension.generateFunctions(callableId, context) - } - - else -> { - emptyList() - } - } - } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcUtils.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcUtils.kt index 54ed7fdea..86f39209e 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcUtils.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirRpcUtils.kt @@ -46,6 +46,7 @@ fun List.rpcAnnotation(session: FirSession, predicate: Declaratio } } +@Suppress("unused") @OptIn(SymbolInternals::class) internal fun FirTypeRef.doesMatchesClassId(session: FirSession, classId: ClassId): Boolean { return coneTypeSafe()?.fullyExpandedType(session)?.lookupTag?.classId == classId diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcAnnotationChecker.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcAnnotationChecker.kt index 8049d18e6..d8057f83b 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcAnnotationChecker.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcAnnotationChecker.kt @@ -4,7 +4,6 @@ package kotlinx.rpc.codegen.checkers -import kotlinx.rpc.codegen.FirCheckersContext import kotlinx.rpc.codegen.FirRpcPredicates import kotlinx.rpc.codegen.checkers.diagnostics.FirRpcDiagnostics import kotlinx.rpc.codegen.common.RpcClassId @@ -21,12 +20,10 @@ import org.jetbrains.kotlin.fir.types.resolvedType object FirRpcAnnotationChecker { fun check( - ctx: FirCheckersContext, declaration: FirRegularClass, context: CheckerContext, reporter: DiagnosticReporter, ) { - val rpcAnnotated = context.session.predicateBasedProvider.matches(FirRpcPredicates.rpc, declaration) val rpcMetaAnnotated = context.session.predicateBasedProvider.matches(FirRpcPredicates.rpcMeta, declaration) val isMetaAnnotated = declaration.classKind != ClassKind.ANNOTATION_CLASS @@ -48,17 +45,5 @@ object FirRpcAnnotationChecker { ?: error("Unexpected unresolved annotation type for declaration: ${declaration.symbol.classId.asSingleFqName()}"), ) } - - if (rpcAnnotated && !ctx.serializationIsPresent && isMetaAnnotated) { - reporter.reportOn( - source = declaration.symbol.rpcAnnotationSource( - session = context.session, - predicate = FirRpcPredicates.rpcMeta, - classId = RpcClassId.rpcAnnotation, - ), - factory = FirRpcDiagnostics.MISSING_SERIALIZATION_MODULE, - context = context, - ) - } } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcCheckers.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcCheckers.kt index a31a73cff..343a86df7 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcCheckers.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcCheckers.kt @@ -15,8 +15,8 @@ import org.jetbrains.kotlin.fir.analysis.checkers.expression.FirFunctionCallChec class FirRpcDeclarationCheckers(ctx: FirCheckersContext) : DeclarationCheckers() { override val regularClassCheckers: Set = setOfNotNull( - FirRpcAnnotationCheckerVS(ctx), - if (ctx.serializationIsPresent) FirRpcStrictModeClassCheckerVS() else null, + FirRpcAnnotationCheckerVS(), + FirRpcStrictModeClassCheckerVS(), FirRpcServiceDeclarationCheckerVS(ctx), ) diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcStrictModeClassChecker.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcStrictModeClassChecker.kt index 5b0ba1dfd..208630e0c 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcStrictModeClassChecker.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/FirRpcStrictModeClassChecker.kt @@ -26,8 +26,6 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol import org.jetbrains.kotlin.fir.types.FirTypeRef import org.jetbrains.kotlin.utils.memoryOptimizedMap import org.jetbrains.kotlin.utils.memoryOptimizedPlus -import org.jetbrains.kotlinx.serialization.compiler.fir.services.FirSerializablePropertiesProvider -import org.jetbrains.kotlinx.serialization.compiler.fir.services.serializablePropertiesProvider object FirRpcStrictModeClassChecker { fun check( @@ -141,13 +139,12 @@ object FirRpcStrictModeClassChecker { } serializablePropertiesProvider.getSerializablePropertiesForClass(symbol) - .serializableProperties .mapNotNull { property -> - val resolvedTypeRef = property.propertySymbol.resolvedReturnTypeRef + val resolvedTypeRef = property.resolvedReturnTypeRef if (resolvedTypeRef.toClassLikeSymbol(context.session) != null) { resolvedTypeRef } else { - extracted[property.propertySymbol.resolvedReturnType] + extracted[property.resolvedReturnType] } }.memoryOptimizedPlus(flowProps) .forEach { symbol -> diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/SerializableProperties.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/SerializableProperties.kt new file mode 100644 index 000000000..9ede91b2b --- /dev/null +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/SerializableProperties.kt @@ -0,0 +1,116 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.codegen.checkers + +import kotlinx.rpc.codegen.common.RpcClassId +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.descriptors.Visibilities +import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol +import org.jetbrains.kotlin.fir.caches.FirCache +import org.jetbrains.kotlin.fir.caches.createCache +import org.jetbrains.kotlin.fir.caches.firCachesFactory +import org.jetbrains.kotlin.fir.caches.getValue +import org.jetbrains.kotlin.fir.declarations.FirDeclarationOrigin +import org.jetbrains.kotlin.fir.declarations.getAnnotationByClassId +import org.jetbrains.kotlin.fir.declarations.utils.correspondingValueParameterFromPrimaryConstructor +import org.jetbrains.kotlin.fir.declarations.utils.hasBackingField +import org.jetbrains.kotlin.fir.declarations.utils.visibility +import org.jetbrains.kotlin.fir.deserialization.registeredInSerializationPluginMetadataExtension +import org.jetbrains.kotlin.fir.expressions.FirAnnotation +import org.jetbrains.kotlin.fir.extensions.FirExtensionSessionComponent +import org.jetbrains.kotlin.fir.resolve.fullyExpandedType +import org.jetbrains.kotlin.fir.resolve.toRegularClassSymbol +import org.jetbrains.kotlin.fir.scopes.impl.declaredMemberScope +import org.jetbrains.kotlin.fir.scopes.processAllProperties +import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol +import org.jetbrains.kotlin.name.StandardClassIds +import org.jetbrains.kotlin.utils.addIfNotNull + +internal val FirSession.serializablePropertiesProvider: FirSerializablePropertiesProvider by FirSession.sessionComponentAccessor() + +internal class FirSerializablePropertiesProvider(session: FirSession) : FirExtensionSessionComponent(session) { + private val cache: FirCache, List, Nothing?> = + session.firCachesFactory.createCache(this::createSerializableProperties) + + fun getSerializablePropertiesForClass(classSymbol: FirClassSymbol<*>): List { + return cache.getValue(classSymbol) + } + + private fun createSerializableProperties(classSymbol: FirClassSymbol<*>): List { + val allPropertySymbols = buildList { + classSymbol + .declaredMemberScope(session, memberRequiredPhase = null) + .processAllProperties { + addIfNotNull(it as? FirPropertySymbol) + } + } + + val primaryConstructorProperties = allPropertySymbols.mapNotNull { + val parameterSymbol = it.correspondingValueParameterFromPrimaryConstructor ?: return@mapNotNull null + it to parameterSymbol.hasDefaultValue + }.toMap().withDefault { false } + + fun isPropertySerializable(propertySymbol: FirPropertySymbol): Boolean { + return when { + propertySymbol in primaryConstructorProperties -> true + propertySymbol.isVal -> !propertySymbol.hasSerialTransient(session) + propertySymbol.visibility == Visibilities.Private -> false + else -> (propertySymbol.isVar && propertySymbol.hasSerialTransient(session)) + } + } + + val serializableProperties = allPropertySymbols.asSequence() + .filter { isPropertySerializable(it) } + .map { FirSerializableProperty(session, it) } + .filterNot { it.transient } + .map { it.propertySymbol } + .let { own -> + val superClassSymbol = classSymbol.superClassNotAny(session) + buildList { + if (superClassSymbol != null) { + addAll(getSerializablePropertiesForClass(superClassSymbol)) + } + addAll(own) + } + } + + return serializableProperties + } +} + +private class FirSerializableProperty( + session: FirSession, + val propertySymbol: FirPropertySymbol, +) { + val transient: Boolean = run { + if (propertySymbol.hasSerialTransient(session)) return@run true + val hasBackingField = when (propertySymbol.origin) { + FirDeclarationOrigin.Library -> propertySymbol.registeredInSerializationPluginMetadataExtension + else -> propertySymbol.hasBackingField + } + !hasBackingField + } +} + +private fun FirBasedSymbol<*>.hasSerialTransient(session: FirSession): Boolean = getSerialTransientAnnotation(session) != null + +private fun FirBasedSymbol<*>.getSerialTransientAnnotation(session: FirSession): FirAnnotation? = + getAnnotationByClassId(RpcClassId.serializationTransient, session) + +private fun FirClassSymbol<*>.superClassNotAny(session: FirSession): FirRegularClassSymbol? { + return superClassOrAny(session).takeUnless { it.classId == StandardClassIds.Any } +} + +private fun FirClassSymbol<*>.superClassOrAny(session: FirSession): FirRegularClassSymbol { + return resolvedSuperTypes.firstNotNullOfOrNull { superType -> + superType.fullyExpandedType(session) + .toRegularClassSymbol(session) + ?.takeIf { it.classKind == ClassKind.CLASS } + } ?: session.builtinTypes.anyType.toRegularClassSymbol(session) ?: error("Symbol for kotlin/Any not found") +} diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt index 48cbb9bbd..6cb21ed7f 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/FirRpcDiagnostics.kt @@ -25,7 +25,6 @@ import org.jetbrains.kotlin.psi.KtElement // ########################################################################### object FirRpcDiagnostics : RpcKtDiagnosticsContainer() { - val MISSING_SERIALIZATION_MODULE by error0() val WRONG_RPC_ANNOTATION_TARGET by error1() val CHECKED_ANNOTATION_VIOLATION by error3>() val NON_SUSPENDING_REQUEST_WITHOUT_STREAMING_RETURN_TYPE by error0() diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/RpcDiagnosticRendererFactory.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/RpcDiagnosticRendererFactory.kt index 56f83a855..e1bc0e34c 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/RpcDiagnosticRendererFactory.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/diagnostics/RpcDiagnosticRendererFactory.kt @@ -10,13 +10,6 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers object RpcDiagnosticRendererFactory : BaseDiagnosticRendererFactory() { override val MAP by RpcKtDiagnosticFactoryToRendererMap("Rpc") { map -> - map.put( - factory = FirRpcDiagnostics.MISSING_SERIALIZATION_MODULE, - message = "Missing kotlinx.serialization plugin in the module. " + - "Service generation will not be available. " + - "Add kotlin(\"plugin.serialization\") to your build.gradle.kts plugins section." - ) - map.put( factory = FirRpcDiagnostics.WRONG_RPC_ANNOTATION_TARGET, message = "@{0} annotation is only applicable to interfaces and annotation classes.", diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/serialization/SerializationFirResolveExtensionDelegate.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/serialization/SerializationFirResolveExtensionDelegate.kt deleted file mode 100644 index 45cb79b6b..000000000 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/serialization/SerializationFirResolveExtensionDelegate.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. - */ - -package kotlinx.rpc.codegen.serialization - -import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol -import org.jetbrains.kotlinx.serialization.compiler.fir.SerializationFirResolveExtension - -internal fun SerializationFirResolveExtension.generateSerializerImplClass( - owner: FirRegularClassSymbol, -): FirClassLikeSymbol<*> { - return callPrivateMethod("generateSerializerImplClass", owner) -} - -internal fun SerializationFirResolveExtension.generateCompanionDeclaration( - owner: FirRegularClassSymbol, -): FirRegularClassSymbol? { - return callPrivateMethod("generateCompanionDeclaration", owner) -} - -private fun SerializationFirResolveExtension.callPrivateMethod(name: String, arg: Any?): T { - val method = this::class.java.declaredMethods.find { it.name == name } - ?: error("Expected method with name $name in SerializationFirResolveExtension") - - method.isAccessible = true - - @Suppress("UNCHECKED_CAST") - return method.invoke(this, arg) as T -} diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/serialization/annotation.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/serialization/annotation.kt deleted file mode 100644 index f0830b5b5..000000000 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/serialization/annotation.kt +++ /dev/null @@ -1,47 +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.serialization - -import kotlinx.rpc.codegen.vsApi -import org.jetbrains.kotlin.fir.FirAnnotationContainer -import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.expressions.buildResolvedArgumentList -import org.jetbrains.kotlin.fir.expressions.builder.buildAnnotationCall -import org.jetbrains.kotlin.fir.references.builder.buildResolvedNamedReference -import org.jetbrains.kotlin.fir.resolve.defaultType -import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider -import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol -import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef -import org.jetbrains.kotlin.name.ClassId - -fun FirAnnotationContainer.addAnnotation(annotationId: ClassId, session: FirSession) { - val annotation = session - .symbolProvider - .getClassLikeSymbolByClassId(annotationId) - as? FirRegularClassSymbol ?: return - - val annotationConstructor = vsApi { - annotation - .constructorsVS(session) - .firstOrNull() ?: return - } - - val annotationCall = buildAnnotationCall { - argumentList = buildResolvedArgumentList(null, linkedMapOf()) - annotationTypeRef = buildResolvedTypeRef { - vsApi { - coneTypeVS = annotation.defaultType() - } - } - calleeReference = buildResolvedNamedReference { - name = annotation.name - resolvedSymbol = annotationConstructor - } - - containingDeclarationSymbol = annotationConstructor - } - - replaceAnnotations(annotations + annotationCall) -} diff --git a/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt b/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt index f6fcdbcad..0dc9e1f59 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt @@ -51,9 +51,9 @@ class FirCheckedAnnotationFirFunctionCheckerVS( } } -class FirRpcAnnotationCheckerVS(private val ctx: FirCheckersContext) : FirRegularClassChecker(MppCheckerKind.Common) { +class FirRpcAnnotationCheckerVS : FirRegularClassChecker(MppCheckerKind.Common) { override fun check(declaration: FirRegularClass, context: CheckerContext, reporter: DiagnosticReporter) { - FirRpcAnnotationChecker.check(ctx, declaration, context, reporter) + FirRpcAnnotationChecker.check(declaration, context, reporter) } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt index f6fcdbcad..0dc9e1f59 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt @@ -51,9 +51,9 @@ class FirCheckedAnnotationFirFunctionCheckerVS( } } -class FirRpcAnnotationCheckerVS(private val ctx: FirCheckersContext) : FirRegularClassChecker(MppCheckerKind.Common) { +class FirRpcAnnotationCheckerVS : FirRegularClassChecker(MppCheckerKind.Common) { override fun check(declaration: FirRegularClass, context: CheckerContext, reporter: DiagnosticReporter) { - FirRpcAnnotationChecker.check(ctx, declaration, context, reporter) + FirRpcAnnotationChecker.check(declaration, context, reporter) } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt index f6fcdbcad..0dc9e1f59 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt @@ -51,9 +51,9 @@ class FirCheckedAnnotationFirFunctionCheckerVS( } } -class FirRpcAnnotationCheckerVS(private val ctx: FirCheckersContext) : FirRegularClassChecker(MppCheckerKind.Common) { +class FirRpcAnnotationCheckerVS : FirRegularClassChecker(MppCheckerKind.Common) { override fun check(declaration: FirRegularClass, context: CheckerContext, reporter: DiagnosticReporter) { - FirRpcAnnotationChecker.check(ctx, declaration, context, reporter) + FirRpcAnnotationChecker.check(declaration, context, reporter) } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt index dad111824..319548b6a 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt @@ -55,10 +55,10 @@ class FirCheckedAnnotationFirFunctionCheckerVS( } } -class FirRpcAnnotationCheckerVS(private val ctx: FirCheckersContext) : FirRegularClassChecker(MppCheckerKind.Common) { +class FirRpcAnnotationCheckerVS : FirRegularClassChecker(MppCheckerKind.Common) { context(context: CheckerContext, reporter: DiagnosticReporter) override fun check(declaration: FirRegularClass) { - FirRpcAnnotationChecker.check(ctx, declaration, context, reporter) + FirRpcAnnotationChecker.check(declaration, context, reporter) } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt index dad111824..319548b6a 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/checkers/FirRpcCheckersVS.kt @@ -55,10 +55,10 @@ class FirCheckedAnnotationFirFunctionCheckerVS( } } -class FirRpcAnnotationCheckerVS(private val ctx: FirCheckersContext) : FirRegularClassChecker(MppCheckerKind.Common) { +class FirRpcAnnotationCheckerVS : FirRegularClassChecker(MppCheckerKind.Common) { context(context: CheckerContext, reporter: DiagnosticReporter) override fun check(declaration: FirRegularClass) { - FirRpcAnnotationChecker.check(ctx, declaration, context, reporter) + FirRpcAnnotationChecker.check(declaration, context, reporter) } } diff --git a/core/build.gradle.kts b/core/build.gradle.kts index d60f2eacc..8dc35d2da 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -6,7 +6,6 @@ import util.applyAtomicfuPlugin plugins { alias(libs.plugins.conventions.kmp) - alias(libs.plugins.serialization) alias(libs.plugins.kotlinx.rpc) } @@ -19,7 +18,9 @@ kotlin { api(projects.utils) api(libs.coroutines.core) + // TODO Remove after KRPC-178 implementation(libs.serialization.core) + implementation(libs.kotlin.reflect) } } diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/RpcCall.kt b/core/src/commonMain/kotlin/kotlinx/rpc/RpcCall.kt index b7cc9a488..12a555f1e 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/RpcCall.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/RpcCall.kt @@ -11,12 +11,12 @@ import kotlinx.rpc.descriptor.RpcServiceDescriptor * * @property descriptor [RpcServiceDescriptor] of a service that made the call. * @property callableName The name of the method being called. - * @property data The data for the call. + * @property parameters array of parameters for the call * @property serviceId The id of the service that made the call. */ -public data class RpcCall( - val descriptor: RpcServiceDescriptor<*>, - val callableName: String, - val data: Any, - val serviceId: Long, +public class RpcCall( + public val descriptor: RpcServiceDescriptor<*>, + public val callableName: String, + public val parameters: Array, + public val serviceId: Long, ) diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptor.kt b/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptor.kt index 4873b9193..666568ed3 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptor.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptor.kt @@ -48,29 +48,41 @@ public interface RpcServiceDescriptor<@Rpc T : Any> { } @ExperimentalRpcApi -public class RpcCallable<@Rpc T : Any>( - public val name: String, - public val dataType: RpcType, - public val returnType: RpcType, - public val invokator: RpcInvokator, - public val parameters: Array, - public val isNonSuspendFunction: Boolean, -) +public interface RpcCallable<@Rpc T : Any> { + public val name: String + public val returnType: RpcType + public val invokator: RpcInvokator + public val parameters: Array + public val isNonSuspendFunction: Boolean +} @ExperimentalRpcApi public sealed interface RpcInvokator<@Rpc T : Any> { @ExperimentalRpcApi public fun interface Method<@Rpc T : Any> : RpcInvokator { - public suspend fun call(service: T, data: Any?): Any? + public suspend fun call(service: T, parameters: Array): Any? } } @ExperimentalRpcApi -public class RpcParameter(public val name: String, public val type: RpcType) +public interface RpcParameter { + public val name: String + public val type: RpcType + + /** + * List of annotations with target [AnnotationTarget.VALUE_PARAMETER]. + * + * Don't confuse with [RpcType.annotations]. + */ + public val annotations: List +} @ExperimentalRpcApi -public class RpcType(public val kType: KType) { - override fun toString(): String { - return kType.toString() - } +public interface RpcType { + public val kType: KType + + /** + * List of annotations with target [AnnotationTarget.TYPE]. + */ + public val annotations: List } diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptorDefault.kt b/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptorDefault.kt new file mode 100644 index 000000000..e4c79456b --- /dev/null +++ b/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptorDefault.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.descriptor + +import kotlinx.rpc.annotations.Rpc +import kotlinx.rpc.internal.utils.InternalRpcApi +import kotlin.reflect.KType + +@InternalRpcApi +public class RpcCallableDefault<@Rpc T : Any>( + override val name: String, + override val returnType: RpcType, + override val invokator: RpcInvokator, + override val parameters: Array, + override val isNonSuspendFunction: Boolean, +) : RpcCallable + +@InternalRpcApi +public class RpcParameterDefault( + override val name: String, + override val type: RpcType, + override val annotations: List, +) : RpcParameter + +@InternalRpcApi +public class RpcTypeDefault( + override val kType: KType, + override val annotations: List, +) : RpcType { + override fun toString(): String { + return kType.toString() + } +} diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptorKrpc.kt b/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptorKrpc.kt new file mode 100644 index 000000000..4584ab6b1 --- /dev/null +++ b/core/src/commonMain/kotlin/kotlinx/rpc/descriptor/RpcServiceDescriptorKrpc.kt @@ -0,0 +1,31 @@ +@file:Suppress("detekt.MatchingDeclarationName") + +/* + * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ + +package kotlinx.rpc.descriptor + +import kotlinx.rpc.internal.utils.InternalRpcApi +import kotlinx.serialization.KSerializer +import kotlin.reflect.KClass +import kotlin.reflect.KType + +/** + * TODO KRPC-178 General Approach for custom Service Descriptors; + * Move to a custom descriptor later + */ +@InternalRpcApi +public class RpcTypeKrpc( + override val kType: KType, + override val annotations: List, + /** + * Contains serializer instances from [kotlinx.serialization.Serializable.with] parameters from [annotations], + * mapped by their [KClass]. + */ + public val serializers: Map>, KSerializer>, +) : RpcType { + override fun toString(): String { + return kType.toString() + } +} diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/internal/RpcMethodClass.kt b/core/src/commonMain/kotlin/kotlinx/rpc/internal/RpcMethodClass.kt deleted file mode 100644 index 36ffa2c34..000000000 --- a/core/src/commonMain/kotlin/kotlinx/rpc/internal/RpcMethodClass.kt +++ /dev/null @@ -1,12 +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.internal - -import kotlinx.rpc.internal.utils.InternalRpcApi - -@InternalRpcApi -public interface RpcMethodClass { - public fun asArray(): Array -} diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/internal/rpcInternalDataCast.kt b/core/src/commonMain/kotlin/kotlinx/rpc/internal/rpcInternalDataCast.kt deleted file mode 100644 index d76e04fce..000000000 --- a/core/src/commonMain/kotlin/kotlinx/rpc/internal/rpcInternalDataCast.kt +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -package kotlinx.rpc.internal - -import kotlinx.rpc.internal.utils.InternalRpcApi - -@InternalRpcApi -public inline fun Any?.rpcInternalDataCast(methodName: String, serviceName: String): T { - return this as? T - ?: throw IllegalArgumentException( - "Wrong data type for $methodName in service $serviceName. " + - "Please, provide only data that is generated by the service " + - "and passed in RpcCall.data, or deserialized version of this data." - ) -} diff --git a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/KrpcClient.kt b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/KrpcClient.kt index 65dd4fcd9..61b58282b 100644 --- a/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/KrpcClient.kt +++ b/krpc/krpc-client/src/commonMain/kotlin/kotlinx/rpc/krpc/client/KrpcClient.kt @@ -337,7 +337,7 @@ public abstract class KrpcClient : RpcClient, KrpcEndpoint { is KrpcCallMessage.CallSuccess, is KrpcCallMessage.StreamMessage -> { val value = runCatching { val serializerResult = serialFormat.serializersModule - .rpcSerializerForType(callable.returnType) + .buildContextual(callable.returnType) decodeMessageData(serialFormat, serializerResult, message) } @@ -380,11 +380,12 @@ public abstract class KrpcClient : RpcClient, KrpcEndpoint { serialFormat: SerialFormat, pluginParams: Map = emptyMap(), ): KrpcCallMessage { - val serializerData = serialFormat.serializersModule.rpcSerializerForType(callable.dataType) + val parametersSerializer = CallableParametersSerializer(callable, serialFormat.serializersModule) + return when (serialFormat) { is StringFormat -> { val stringValue = clientStreamContext.scoped(callId, call.serviceId) { - serialFormat.encodeToString(serializerData, call.data) + serialFormat.encodeToString(parametersSerializer, call.parameters) } KrpcCallMessage.CallDataString( @@ -401,7 +402,7 @@ public abstract class KrpcClient : RpcClient, KrpcEndpoint { is BinaryFormat -> { val binaryValue = clientStreamContext.scoped(callId, call.serviceId) { - serialFormat.encodeToByteArray(serializerData, call.data) + serialFormat.encodeToByteArray(parametersSerializer, call.parameters) } KrpcCallMessage.CallDataBinary( diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/CancellationType.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/CancellationType.kt index b268df712..645f839e6 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/CancellationType.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/CancellationType.kt @@ -4,7 +4,6 @@ package kotlinx.rpc.krpc.internal -import kotlinx.rpc.internal.utils.RpcInternalIndexedEnum import kotlinx.rpc.internal.utils.InternalRpcApi @InternalRpcApi diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPlugin.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPlugin.kt index 55243646a..f4d4d7a82 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPlugin.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPlugin.kt @@ -4,9 +4,7 @@ package kotlinx.rpc.krpc.internal -import kotlinx.rpc.internal.utils.RpcInternalIndexedEnum import kotlinx.rpc.internal.utils.InternalRpcApi -import kotlinx.rpc.internal.utils.RpcInternalShortEnumKSerializer import kotlinx.serialization.Serializable /** diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPluginKey.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPluginKey.kt index d95526d3f..8401c6c43 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPluginKey.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/KrpcPluginKey.kt @@ -4,9 +4,7 @@ package kotlinx.rpc.krpc.internal -import kotlinx.rpc.internal.utils.RpcInternalIndexedEnum import kotlinx.rpc.internal.utils.InternalRpcApi -import kotlinx.rpc.internal.utils.RpcInternalShortEnumKSerializer import kotlinx.serialization.Serializable /** diff --git a/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/RpcInternalShortEnumKSerializer.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/RpcInternalShortEnumKSerializer.kt similarity index 95% rename from utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/RpcInternalShortEnumKSerializer.kt rename to krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/RpcInternalShortEnumKSerializer.kt index c7a277a00..1379ae34e 100644 --- a/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/RpcInternalShortEnumKSerializer.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/RpcInternalShortEnumKSerializer.kt @@ -2,8 +2,9 @@ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -package kotlinx.rpc.internal.utils +package kotlinx.rpc.krpc.internal +import kotlinx.rpc.internal.utils.InternalRpcApi import kotlinx.serialization.KSerializer import kotlinx.serialization.descriptors.PrimitiveKind import kotlinx.serialization.descriptors.PrimitiveSerialDescriptor diff --git a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/SerializationUtils.kt b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/SerializationUtils.kt index 5b59f336a..68165e133 100644 --- a/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/SerializationUtils.kt +++ b/krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/SerializationUtils.kt @@ -4,44 +4,50 @@ package kotlinx.rpc.krpc.internal -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.SharedFlow -import kotlinx.coroutines.flow.StateFlow +import kotlinx.rpc.descriptor.RpcCallable import kotlinx.rpc.descriptor.RpcType +import kotlinx.rpc.descriptor.RpcTypeKrpc +import kotlinx.rpc.internal.rpcInternalKClass import kotlinx.rpc.internal.utils.InternalRpcApi import kotlinx.serialization.* +import kotlinx.serialization.descriptors.SerialDescriptor +import kotlinx.serialization.descriptors.buildClassSerialDescriptor +import kotlinx.serialization.encoding.* import kotlinx.serialization.modules.SerializersModule -import kotlin.reflect.KClass import kotlin.reflect.KType @OptIn(ExperimentalSerializationApi::class) -internal fun SerializersModule.buildContextual(type: KType): KSerializer { +internal fun SerializersModule.buildContextualInternal(type: KType): KSerializer? { val result = getContextual( - kClass = type.classifier as? KClass<*> ?: error("Unknown type $type"), - typeArgumentsSerializers = type.arguments.map { - rpcSerializerForType( - it.type ?: error("No type information for $type<$it>") - ) + kClass = type.rpcInternalKClass(), + typeArgumentsSerializers = type.arguments.mapIndexed { i, typeArgument -> + val typeArg = typeArgument.type + ?: error("Unexpected star projection type at index $i in type arguments list of '$type'") + + buildContextualInternal(typeArg) ?: serializer(typeArg) } ) + @Suppress("UNCHECKED_CAST") - return result as? KSerializer ?: error("No serializer found for $type") + return result as? KSerializer } -@InternalRpcApi -public fun SerializersModule.rpcSerializerForType(type: RpcType): KSerializer { - return rpcSerializerForType(type.kType) +private fun SerializersModule.buildContextual(type: KType): KSerializer { + return buildContextualInternal(type) ?: serializer(type) } +@OptIn(ExperimentalSerializationApi::class) @InternalRpcApi -public fun SerializersModule.rpcSerializerForType(type: KType): KSerializer { - return when (type.classifier) { - Flow::class, SharedFlow::class, StateFlow::class -> buildContextual(type) - else -> serializer(type) - } +public fun SerializersModule.buildContextual(type: RpcType): KSerializer { + return type.annotations + .filterIsInstance() + .lastOrNull() + ?.let { + (type as? RpcTypeKrpc)?.serializers[it.with] + } + ?: buildContextual(type.kType) } - @InternalRpcApi public fun unsupportedSerialFormatError(serialFormat: SerialFormat): Nothing { error("Unsupported serial format ${serialFormat::class}, only StringFormat and BinaryFormats are supported") @@ -56,16 +62,18 @@ internal fun unexpectedDataFormatForProvidedSerialFormat( else -> "StringFormat" to "binary" } - error("Unexpected message format for provided serial format: " + - "message is in $actual format (${data::class}), but provided SerialFormat is $expected") + error( + "Unexpected message format for provided serial format: " + + "message is in $actual format (${data::class}), but provided SerialFormat is $expected" + ) } @InternalRpcApi -public fun decodeMessageData( +public fun decodeMessageData( serialFormat: SerialFormat, - dataSerializer: KSerializer, + dataSerializer: KSerializer, data: KrpcCallMessage.Data, -): Any? { +): T { return when (serialFormat) { is StringFormat -> { if (data !is KrpcCallMessage.Data.StringData) { @@ -88,3 +96,52 @@ public fun decodeMessageData( } } } + +@InternalRpcApi +public class CallableParametersSerializer( + private val callable: RpcCallable<*>, + private val module: SerializersModule, +) : KSerializer> { + private val callableSerializers = Array(callable.parameters.size) { i -> + module.buildContextual(callable.parameters[i].type) + } + + override val descriptor: SerialDescriptor = buildClassSerialDescriptor("CallableParametersSerializer") { + for (i in callableSerializers.indices) { + val param = callable.parameters[i] + element( + elementName = param.name, + descriptor = callableSerializers[i].descriptor, + annotations = param.type.annotations, + isOptional = param.type.kType.isMarkedNullable, + ) + } + } + + override fun serialize( + encoder: Encoder, + value: Array, + ) { + encoder.encodeStructure(descriptor) { + for (i in callable.parameters.indices) { + encodeSerializableElement(descriptor, i, callableSerializers[i], value[i]) + } + } + } + + override fun deserialize(decoder: Decoder): Array { + return decoder.decodeStructure(descriptor) { + val result = arrayOfNulls(callable.parameters.size) + while (true) { + val index = decodeElementIndex(descriptor) + if (index == CompositeDecoder.DECODE_DONE) { + break + } + + result[index] = decodeSerializableElement(descriptor, index, callableSerializers[index]) + } + + result + } + } +} diff --git a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerService.kt b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerService.kt index 5f4a10cb4..9e0afcf5d 100644 --- a/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerService.kt +++ b/krpc/krpc-server/src/commonMain/kotlin/kotlinx/rpc/krpc/server/internal/KrpcServerService.kt @@ -128,14 +128,10 @@ internal class KrpcServerService<@Rpc T : Any>( error("Service ${descriptor.fqName} has no $callType '$callableName'") } - val data = if (isMethod) { - val serializerModule = serialFormat.serializersModule - val paramsSerializer = serializerModule.rpcSerializerForType(callable.dataType) - serverStreamContext.scoped(callId) { - decodeMessageData(serialFormat, paramsSerializer, callData) - } - } else { - null + val paramsSerializer = CallableParametersSerializer(callable, serialFormat.serializersModule) + + val data = serverStreamContext.scoped(callId) { + decodeMessageData(serialFormat, paramsSerializer, callData) } var failure: Throwable? = null @@ -168,7 +164,8 @@ internal class KrpcServerService<@Rpc T : Any>( } val returnType = callable.returnType - val returnSerializer = serialFormat.serializersModule.rpcSerializerForType(returnType) + val returnSerializer = serialFormat.serializersModule + .buildContextual(returnType) if (callable.isNonSuspendFunction) { if (value !is Flow<*>) { diff --git a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestService.kt b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestService.kt index 45aca6030..48791b4ee 100644 --- a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestService.kt +++ b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestService.kt @@ -6,7 +6,6 @@ package kotlinx.rpc.krpc.test import kotlinx.coroutines.flow.Flow import kotlinx.rpc.annotations.Rpc -import kotlinx.serialization.Contextual import kotlinx.serialization.Serializable data class LocalDate( @@ -62,12 +61,12 @@ interface KrpcTestService { suspend fun mapParams(arg1: Map>>) suspend fun customType(arg1: TestClass): TestClass suspend fun nullable(arg1: String?): TestClass? - suspend fun variance(arg2: TestList, arg3: TestList2<*>): TestList? + suspend fun variance(arg2: TestList, arg3: TestList2): TestList? - suspend fun nonSerializableClass(localDate: @Contextual LocalDate): LocalDate + suspend fun nonSerializableClass(localDate: LocalDate): LocalDate suspend fun nonSerializableClassWithSerializer( localDateTime: @Serializable(LocalDateTimeSerializer::class) LocalDateTime, - ): String + ): @Serializable(LocalDateTimeSerializer::class) LocalDateTime suspend fun incomingStreamSyncCollect(arg1: Flow): Int suspend fun incomingStreamSyncCollectMultiple(arg1: Flow, arg2: Flow, arg3: Flow): Int diff --git a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.kt b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.kt index 2ec18fb82..ba162a66f 100644 --- a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.kt +++ b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTestServiceBackend.kt @@ -114,7 +114,7 @@ class KrpcTestServiceBackend : KrpcTestService { return LocalDate(localDate.year, localDate.month, localDate.day + 1) } - override suspend fun nonSerializableClassWithSerializer(localDateTime: LocalDateTime): String { + override suspend fun nonSerializableClassWithSerializer(localDateTime: LocalDateTime): LocalDateTime { return LocalDateTime( date = LocalDate( year = localDateTime.date.year, @@ -122,7 +122,7 @@ class KrpcTestServiceBackend : KrpcTestService { day = localDateTime.date.day + 1, ), time = localDateTime.time, - ).toString() + ) } override suspend fun incomingStreamSyncCollect(arg1: Flow): Int { diff --git a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt index 10ce18120..4e2e0da78 100644 --- a/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt +++ b/krpc/krpc-test/src/commonMain/kotlin/kotlinx/rpc/krpc/test/KrpcTransportTestBase.kt @@ -170,7 +170,7 @@ abstract class KrpcTransportTestBase { val resultDateTime = client.nonSerializableClassWithSerializer(localDateTime) assertEquals( - LocalDateTime(LocalDate(2001, 8, 24), "17:03").toString(), + LocalDateTime(LocalDate(2001, 8, 24), "17:03"), resultDateTime, ) } diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/IndexedEnumTest.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/IndexedEnumTest.kt index cad263d6a..93bf20b9e 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/IndexedEnumTest.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/IndexedEnumTest.kt @@ -4,7 +4,7 @@ package kotlinx.rpc.krpc.test.api -import kotlinx.rpc.internal.utils.RpcInternalIndexedEnum +import kotlinx.rpc.krpc.internal.RpcInternalIndexedEnum import kotlinx.rpc.krpc.test.api.ApiVersioningTest.Companion.INDEXED_ENUM_DUMPS_DIR import kotlinx.rpc.krpc.test.api.util.GoldComparable import kotlinx.rpc.krpc.test.api.util.GoldComparisonResult diff --git a/tests/compiler-plugin-tests/build.gradle.kts b/tests/compiler-plugin-tests/build.gradle.kts index 18f14414b..e50c28f5d 100644 --- a/tests/compiler-plugin-tests/build.gradle.kts +++ b/tests/compiler-plugin-tests/build.gradle.kts @@ -4,8 +4,6 @@ import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -import util.otherwise -import util.whenForIde plugins { java @@ -72,14 +70,6 @@ dependencies { testRuntimeOnly(libs.kotlin.script.runtime) testRuntimeOnly(libs.kotlin.annotations.jvm) - whenForIde { - testImplementation(libs.serialization.plugin.forIde) { - isTransitive = false - } - } otherwise { - testImplementation(libs.serialization.plugin) - } - testImplementation(libs.compiler.plugin.common) testImplementation(libs.compiler.plugin.backend) testImplementation(libs.compiler.plugin.k2) 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 index 228579de0..23dbdd24e 100644 --- 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 @@ -14,7 +14,6 @@ import org.jetbrains.kotlin.test.directives.model.SimpleDirectivesContainer 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 val directiveContainers: List = listOf(RpcDirectives) @@ -32,9 +31,6 @@ class ExtensionRegistrarConfigurator(testServices: TestServices) : EnvironmentCo } registerRpcExtensions(configuration) - - // libs - SerializationComponentRegistrar.registerExtensions(this) } } diff --git a/utils/build.gradle.kts b/utils/build.gradle.kts index 1a8f9afa9..a1584fbeb 100644 --- a/utils/build.gradle.kts +++ b/utils/build.gradle.kts @@ -14,7 +14,6 @@ kotlin { sourceSets { commonMain { dependencies { - implementation(libs.serialization.core) implementation(libs.coroutines.core) } } diff --git a/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/map/RpcInternalConcurrentHashMap.kt b/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/map/RpcInternalConcurrentHashMap.kt index 1818a1709..dd3556ddc 100644 --- a/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/map/RpcInternalConcurrentHashMap.kt +++ b/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/map/RpcInternalConcurrentHashMap.kt @@ -14,7 +14,7 @@ public interface RpcInternalConcurrentHashMap { put(key, value) } - public fun merge(key: K, value: V, remappingFunction: (V, V) -> V): V? + public fun merge(key: K, value: V, remappingFunction: (V, V) -> V): V public fun computeIfAbsent(key: K, computeValue: () -> V): V diff --git a/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/map/SynchronizedHashMap.kt b/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/map/SynchronizedHashMap.kt index 502ec6e34..d855b8a6a 100644 --- a/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/map/SynchronizedHashMap.kt +++ b/utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/map/SynchronizedHashMap.kt @@ -14,7 +14,7 @@ internal class SynchronizedHashMap : RpcInternalConcurrentHashM map.put(key, value) } - override fun merge(key: K, value: V, remappingFunction: (V, V) -> V): V? = synchronized(this) { + override fun merge(key: K, value: V, remappingFunction: (V, V) -> V): V = synchronized(this) { val old = map[key] if (old == null) { map[key] = value diff --git a/utils/src/jvmMain/kotlin/kotlinx/rpc/internal/utils/map/ConcurrentHashMap.jvm.kt b/utils/src/jvmMain/kotlin/kotlinx/rpc/internal/utils/map/ConcurrentHashMap.jvm.kt index 6a0e5c507..897bdc9a9 100644 --- a/utils/src/jvmMain/kotlin/kotlinx/rpc/internal/utils/map/ConcurrentHashMap.jvm.kt +++ b/utils/src/jvmMain/kotlin/kotlinx/rpc/internal/utils/map/ConcurrentHashMap.jvm.kt @@ -20,8 +20,8 @@ private class ConcurrentHashMapJvm(initialSize: Int) : RpcInter return map.put(key, value) } - override fun merge(key: K, value: V, remappingFunction: (V, V) -> V): V? { - return map.merge(key, value) { old, new -> remappingFunction(old, new) } + override fun merge(key: K, value: V, remappingFunction: (V, V) -> V): V { + return map.merge(key, value) { old, new -> remappingFunction(old, new) }!! } override fun computeIfAbsent(key: K, computeValue: () -> V): V { From 9839e77ce03a9083774f0f26d3fd68247418d3cb Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Fri, 13 Jun 2025 17:12:44 +0200 Subject: [PATCH 2/4] apiDump --- core/api/core.api | 44 ++++++++++++++++---------------------------- 1 file changed, 16 insertions(+), 28 deletions(-) diff --git a/core/api/core.api b/core/api/core.api index 4830d8914..d208cb15c 100644 --- a/core/api/core.api +++ b/core/api/core.api @@ -2,20 +2,11 @@ public abstract interface class kotlinx/rpc/RemoteService { } public final class kotlinx/rpc/RpcCall { - public fun (Lkotlinx/rpc/descriptor/RpcServiceDescriptor;Ljava/lang/String;Ljava/lang/Object;J)V - public final fun component1 ()Lkotlinx/rpc/descriptor/RpcServiceDescriptor; - public final fun component2 ()Ljava/lang/String; - public final fun component3 ()Ljava/lang/Object; - public final fun component4 ()J - public final fun copy (Lkotlinx/rpc/descriptor/RpcServiceDescriptor;Ljava/lang/String;Ljava/lang/Object;J)Lkotlinx/rpc/RpcCall; - public static synthetic fun copy$default (Lkotlinx/rpc/RpcCall;Lkotlinx/rpc/descriptor/RpcServiceDescriptor;Ljava/lang/String;Ljava/lang/Object;JILjava/lang/Object;)Lkotlinx/rpc/RpcCall; - public fun equals (Ljava/lang/Object;)Z + public fun (Lkotlinx/rpc/descriptor/RpcServiceDescriptor;Ljava/lang/String;[Ljava/lang/Object;J)V public final fun getCallableName ()Ljava/lang/String; - public final fun getData ()Ljava/lang/Object; public final fun getDescriptor ()Lkotlinx/rpc/descriptor/RpcServiceDescriptor; + public final fun getParameters ()[Ljava/lang/Object; public final fun getServiceId ()J - public fun hashCode ()I - public fun toString ()Ljava/lang/String; } public abstract interface class kotlinx/rpc/RpcClient { @@ -39,27 +30,25 @@ public abstract interface annotation class kotlinx/rpc/annotations/CheckedTypeAn public abstract interface annotation class kotlinx/rpc/annotations/Rpc : java/lang/annotation/Annotation { } -public final class kotlinx/rpc/descriptor/RpcCallable { - public fun (Ljava/lang/String;Lkotlinx/rpc/descriptor/RpcType;Lkotlinx/rpc/descriptor/RpcType;Lkotlinx/rpc/descriptor/RpcInvokator;[Lkotlinx/rpc/descriptor/RpcParameter;Z)V - public final fun getDataType ()Lkotlinx/rpc/descriptor/RpcType; - public final fun getInvokator ()Lkotlinx/rpc/descriptor/RpcInvokator; - public final fun getName ()Ljava/lang/String; - public final fun getParameters ()[Lkotlinx/rpc/descriptor/RpcParameter; - public final fun getReturnType ()Lkotlinx/rpc/descriptor/RpcType; - public final fun isNonSuspendFunction ()Z +public abstract interface class kotlinx/rpc/descriptor/RpcCallable { + public abstract fun getInvokator ()Lkotlinx/rpc/descriptor/RpcInvokator; + public abstract fun getName ()Ljava/lang/String; + public abstract fun getParameters ()[Lkotlinx/rpc/descriptor/RpcParameter; + public abstract fun getReturnType ()Lkotlinx/rpc/descriptor/RpcType; + public abstract fun isNonSuspendFunction ()Z } public abstract interface class kotlinx/rpc/descriptor/RpcInvokator { } public abstract interface class kotlinx/rpc/descriptor/RpcInvokator$Method : kotlinx/rpc/descriptor/RpcInvokator { - public abstract fun call (Ljava/lang/Object;Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public abstract fun call (Ljava/lang/Object;[Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; } -public final class kotlinx/rpc/descriptor/RpcParameter { - public fun (Ljava/lang/String;Lkotlinx/rpc/descriptor/RpcType;)V - public final fun getName ()Ljava/lang/String; - public final fun getType ()Lkotlinx/rpc/descriptor/RpcType; +public abstract interface class kotlinx/rpc/descriptor/RpcParameter { + public abstract fun getAnnotations ()Ljava/util/List; + public abstract fun getName ()Ljava/lang/String; + public abstract fun getType ()Lkotlinx/rpc/descriptor/RpcType; } public abstract interface class kotlinx/rpc/descriptor/RpcServiceDescriptor { @@ -73,9 +62,8 @@ public final class kotlinx/rpc/descriptor/RpcServiceDescriptorKt { public static final fun serviceDescriptorOf (Lkotlin/reflect/KType;)Lkotlinx/rpc/descriptor/RpcServiceDescriptor; } -public final class kotlinx/rpc/descriptor/RpcType { - public fun (Lkotlin/reflect/KType;)V - public final fun getKType ()Lkotlin/reflect/KType; - public fun toString ()Ljava/lang/String; +public abstract interface class kotlinx/rpc/descriptor/RpcType { + public abstract fun getAnnotations ()Ljava/util/List; + public abstract fun getKType ()Lkotlin/reflect/KType; } From daf9e251431da60d8cfff4422ca9f3a8f16e5733 Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Fri, 13 Jun 2025 17:26:49 +0200 Subject: [PATCH 3/4] Update compiler tests --- tests/compiler-plugin-tests/build.gradle.kts | 14 +- .../box/customParameterTypes.fir.ir.txt | 859 +----------------- .../testData/box/customParameterTypes.fir.txt | 93 +- .../src/testData/box/customParameterTypes.kt | 2 - .../src/testData/box/flowParameter.fir.ir.txt | 365 +------- .../src/testData/box/flowParameter.fir.txt | 33 - .../src/testData/box/flowParameter.kt | 1 - .../src/testData/box/multiModule.fir.ir.txt | 89 +- .../src/testData/box/multiModule.fir.txt | 9 - .../src/testData/box/simple.fir.ir.txt | 89 +- .../src/testData/box/simple.fir.txt | 9 - .../testData/diagnostics/rpcService.fir.txt | 84 -- .../src/testData/diagnostics/rpcService.kt | 2 - .../testData/diagnostics/strictMode.fir.txt | 624 +------------ .../src/testData/diagnostics/strictMode.kt | 13 +- 15 files changed, 125 insertions(+), 2161 deletions(-) diff --git a/tests/compiler-plugin-tests/build.gradle.kts b/tests/compiler-plugin-tests/build.gradle.kts index e50c28f5d..51ecfb492 100644 --- a/tests/compiler-plugin-tests/build.gradle.kts +++ b/tests/compiler-plugin-tests/build.gradle.kts @@ -4,6 +4,8 @@ import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import util.otherwise +import util.whenForIde plugins { java @@ -70,6 +72,17 @@ dependencies { testRuntimeOnly(libs.kotlin.script.runtime) testRuntimeOnly(libs.kotlin.annotations.jvm) + // uncomment when serialization is needed for testing again +// whenForIde { +// testImplementation(libs.serialization.plugin.forIde) { +// isTransitive = false +// } +// } otherwise { +// testImplementation(libs.serialization.plugin) +// } +// +// testDataClasspath(libs.serialization.core) + testImplementation(libs.compiler.plugin.common) testImplementation(libs.compiler.plugin.backend) testImplementation(libs.compiler.plugin.k2) @@ -90,7 +103,6 @@ dependencies { testDataClasspath(projects.utils) testDataClasspath(libs.coroutines.core) - testDataClasspath(libs.serialization.core) } val updateTestData = (project.findProperty("kotlin.test.update.test.data") as? String) ?: "false" 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 index aaa43832f..c55ada9f4 100644 --- a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.ir.txt @@ -1,7 +1,5 @@ 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] @@ -14,214 +12,6 @@ FILE fqName: fileName:/customParameterTypes.kt 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]' type=kotlin.Unit - 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 declared in kotlinx.serialization.internal.GeneratedSerializer - 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>]' type=kotlin.Unit - 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 GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] 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 GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:encoder index:0 type:kotlinx.serialization.encoding.Encoder - VALUE_PARAMETER GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] 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 @@ -262,7 +52,7 @@ FILE fqName: fileName:/customParameterTypes.kt 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] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 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 @@ -272,7 +62,7 @@ FILE fqName: fileName:/customParameterTypes.kt 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 + receiver: GET_VAR 'val tmp_0: .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' @@ -298,19 +88,6 @@ FILE fqName: fileName:/customParameterTypes.kt 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:[kotlin.Any] annotations: Rpc @@ -361,21 +138,17 @@ FILE fqName: fileName:/customParameterTypes.kt EXPRESSION_BODY TYPE_OP type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=SAM_CONVERSION typeOperand=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> FUN_EXPR type=kotlin.coroutines.SuspendFunction2<.BoxService, kotlin.Any?, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, data:kotlin.Any?) returnType:kotlin.Any? [suspend] + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, parameters:kotlin.Array) returnType:kotlin.Any? [suspend] VALUE_PARAMETER name:service index:0 type:.BoxService - VALUE_PARAMETER name:data index:1 type:kotlin.Any? + VALUE_PARAMETER name:parameters index:1 type:kotlin.Array BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:.BoxService.$rpcServiceStub.test1$rpcMethod [val] - CALL 'public final fun rpcInternalDataCast (methodName: kotlin.String, serviceName: kotlin.String): T of kotlinx.rpc.internal.rpcInternalDataCast declared in kotlinx.rpc.internal' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null - : .BoxService.$rpcServiceStub.test1$rpcMethod - $receiver: GET_VAR 'data: kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.test1Invokator.' type=kotlin.Any? origin=null - methodName: CONST String type=kotlin.String value="test1" - serviceName: CONST String type=kotlin.String value="BoxService" - RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, data: kotlin.Any?): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.test1Invokator' + RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, parameters: kotlin.Array): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.test1Invokator' CALL 'public abstract fun test1 (testData: .TestData): kotlin.String declared in .BoxService' type=kotlin.String origin=null $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.test1Invokator.' type=.BoxService origin=null - testData: CALL 'public final fun (): .TestData declared in .BoxService.$rpcServiceStub.test1$rpcMethod' type=.TestData origin=GET_PROPERTY - $this: GET_VAR 'val tmp_10: .BoxService.$rpcServiceStub.test1$rpcMethod declared in .BoxService.$rpcServiceStub.Companion.test1Invokator.' type=.BoxService.$rpcServiceStub.test1$rpcMethod origin=null + testData: TYPE_OP type=.TestData origin=CAST typeOperand=.TestData + CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Any? origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'parameters: kotlin.Array declared in .BoxService.$rpcServiceStub.Companion.test1Invokator.' type=kotlin.Array origin=null + index: CONST Int type=kotlin.Int value=0 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> correspondingProperty: PROPERTY name:test1Invokator visibility:private modality:FINAL [val] $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion @@ -388,21 +161,17 @@ FILE fqName: fileName:/customParameterTypes.kt EXPRESSION_BODY TYPE_OP type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=SAM_CONVERSION typeOperand=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> FUN_EXPR type=kotlin.coroutines.SuspendFunction2<.BoxService, kotlin.Any?, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, data:kotlin.Any?) returnType:kotlin.Any? [suspend] + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, parameters:kotlin.Array) returnType:kotlin.Any? [suspend] VALUE_PARAMETER name:service index:0 type:.BoxService - VALUE_PARAMETER name:data index:1 type:kotlin.Any? + VALUE_PARAMETER name:parameters index:1 type:kotlin.Array BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:.BoxService.$rpcServiceStub.test2$rpcMethod [val] - CALL 'public final fun rpcInternalDataCast (methodName: kotlin.String, serviceName: kotlin.String): T of kotlinx.rpc.internal.rpcInternalDataCast declared in kotlinx.rpc.internal' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null - : .BoxService.$rpcServiceStub.test2$rpcMethod - $receiver: GET_VAR 'data: kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.test2Invokator.' type=kotlin.Any? origin=null - methodName: CONST String type=kotlin.String value="test2" - serviceName: CONST String type=kotlin.String value="BoxService" - RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, data: kotlin.Any?): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.test2Invokator' + RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, parameters: kotlin.Array): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.test2Invokator' CALL 'public abstract fun test2 (testData: .TestData): kotlin.String declared in .BoxService' type=kotlin.String origin=null $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.test2Invokator.' type=.BoxService origin=null - testData: CALL 'public final fun (): .TestData declared in .BoxService.$rpcServiceStub.test2$rpcMethod' type=.TestData origin=GET_PROPERTY - $this: GET_VAR 'val tmp_11: .BoxService.$rpcServiceStub.test2$rpcMethod declared in .BoxService.$rpcServiceStub.Companion.test2Invokator.' type=.BoxService.$rpcServiceStub.test2$rpcMethod origin=null + testData: TYPE_OP type=.TestData origin=CAST typeOperand=.TestData + CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Any? origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'parameters: kotlin.Array declared in .BoxService.$rpcServiceStub.Companion.test2Invokator.' type=kotlin.Array origin=null + index: CONST Int type=kotlin.Int value=0 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> correspondingProperty: PROPERTY name:test2Invokator visibility:private modality:FINAL [val] $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion @@ -421,49 +190,55 @@ FILE fqName: fileName:/customParameterTypes.kt : kotlin.String : kotlinx.rpc.descriptor.RpcCallable<.BoxService> $receiver: CONST String type=kotlin.String value="test1" - that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, dataType: kotlinx.rpc.descriptor.RpcType, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallable' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null + that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallableDefault' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null : .BoxService name: CONST String type=kotlin.String value="test1" - dataType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null - kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null - : .BoxService.$rpcServiceStub.test1$rpcMethod - returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null + returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcTypeDefault' type=kotlinx.rpc.descriptor.RpcType origin=null kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null : kotlin.String + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : invokator: CALL 'private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=GET_PROPERTY $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion' type=.BoxService.$rpcServiceStub.Companion origin=null parameters: CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null : kotlinx.rpc.descriptor.RpcParameter elements: VARARG type=kotlin.Array varargElementType=kotlinx.rpc.descriptor.RpcParameter - CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, type: kotlinx.rpc.descriptor.RpcType) declared in kotlinx.rpc.descriptor.RpcParameter' type=kotlinx.rpc.descriptor.RpcParameter origin=null + CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, type: kotlinx.rpc.descriptor.RpcType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcParameterDefault' type=kotlinx.rpc.descriptor.RpcParameter origin=null name: CONST String type=kotlin.String value="testData" - type: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null + type: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcTypeDefault' type=kotlinx.rpc.descriptor.RpcType origin=null kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null : .TestData + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : isNonSuspendFunction: CONST Boolean type=kotlin.Boolean value=false CALL 'public final fun to (that: B of kotlin.to): kotlin.Pair declared in kotlin' type=kotlin.Pair.BoxService>> origin=null : kotlin.String : kotlinx.rpc.descriptor.RpcCallable<.BoxService> $receiver: CONST String type=kotlin.String value="test2" - that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, dataType: kotlinx.rpc.descriptor.RpcType, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallable' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null + that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallableDefault' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null : .BoxService name: CONST String type=kotlin.String value="test2" - dataType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null - kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null - : .BoxService.$rpcServiceStub.test2$rpcMethod - returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null + returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcTypeDefault' type=kotlinx.rpc.descriptor.RpcType origin=null kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null : kotlin.String + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : invokator: CALL 'private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=GET_PROPERTY $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion' type=.BoxService.$rpcServiceStub.Companion origin=null parameters: CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null : kotlinx.rpc.descriptor.RpcParameter elements: VARARG type=kotlin.Array varargElementType=kotlinx.rpc.descriptor.RpcParameter - CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, type: kotlinx.rpc.descriptor.RpcType) declared in kotlinx.rpc.descriptor.RpcParameter' type=kotlinx.rpc.descriptor.RpcParameter origin=null + CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, type: kotlinx.rpc.descriptor.RpcType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcParameterDefault' type=kotlinx.rpc.descriptor.RpcParameter origin=null name: CONST String type=kotlin.String value="testData" - type: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null + type: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcTypeDefault' type=kotlinx.rpc.descriptor.RpcType origin=null kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null : .TestData + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : isNonSuspendFunction: CONST Boolean type=kotlin.Boolean value=false FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlin.collections.Map.BoxService>> correspondingProperty: PROPERTY name:callableMap visibility:private modality:FINAL [val] @@ -511,552 +286,6 @@ FILE fqName: fileName:/customParameterTypes.kt $this: CALL 'private final fun (): kotlin.collections.Map.BoxService>> declared in .BoxService.$rpcServiceStub.Companion' type=kotlin.collections.Map.BoxService>> origin=GET_PROPERTY $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.getCallable' type=.BoxService.$rpcServiceStub.Companion origin=null key: GET_VAR 'name: kotlin.String declared in .BoxService.$rpcServiceStub.Companion.getCallable' type=kotlin.String origin=null - CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] CLASS name:test1$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass] - 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]' type=kotlin.Unit - 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 declared in kotlinx.serialization.internal.GeneratedSerializer - 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_12 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_12: 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_12: 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>]' type=kotlin.Unit - 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 GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:decoder index:0 type:kotlinx.serialization.encoding.Decoder - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_13 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_14 type:kotlin.Boolean [var] - CONST Boolean type=kotlin.Boolean value=true - VAR IR_TEMPORARY_VARIABLE name:tmp_15 type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_16 type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_17 type:.TestData? [var] - CONST Null type=.TestData? value=null - VAR IR_TEMPORARY_VARIABLE name:tmp_18 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_13: 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_18: 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_17: .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_18: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_13: 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_17: .TestData? declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=.TestData? origin=null - SET_VAR 'var tmp_16: 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_16: 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_14: 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_15: 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_18: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_13: 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_15: 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_14: 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_15: 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_17: .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_18: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_13: 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_17: .TestData? declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=.TestData? origin=null - SET_VAR 'var tmp_16: 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_16: 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_15: 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_18: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_13: 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_16: kotlin.Int declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null - testData: GET_VAR 'var tmp_17: .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 GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:encoder index:0 type:kotlinx.serialization.encoding.Encoder - VALUE_PARAMETER GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:value index:1 type:.BoxService.$rpcServiceStub.test1$rpcMethod - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_19 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_20 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_19: 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_20: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null - serialDesc: GET_VAR 'val tmp_19: 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_20: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test1$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null - descriptor: GET_VAR 'val tmp_19: 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:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=kotlin.Unit - 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.RpcMethodClass - $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:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass] - 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]' type=kotlin.Unit - 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 declared in kotlinx.serialization.internal.GeneratedSerializer - 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_21 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_21: 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_21: 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>]' type=kotlin.Unit - 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 GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:decoder index:0 type:kotlinx.serialization.encoding.Decoder - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_22 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_23 type:kotlin.Boolean [var] - CONST Boolean type=kotlin.Boolean value=true - VAR IR_TEMPORARY_VARIABLE name:tmp_24 type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_25 type:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_26 type:.TestData? [var] - CONST Null type=.TestData? value=null - VAR IR_TEMPORARY_VARIABLE name:tmp_27 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_22: 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_27: 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_26: .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_27: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_22: 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_26: .TestData? declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=.TestData? origin=null - SET_VAR 'var tmp_25: 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_25: 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_23: 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_24: 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_27: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_22: 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_24: 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_23: 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_24: 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_26: .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_27: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_22: 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_26: .TestData? declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=.TestData? origin=null - SET_VAR 'var tmp_25: 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_25: 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_24: 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_27: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_22: 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_25: kotlin.Int declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null - testData: GET_VAR 'var tmp_26: .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 GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:encoder index:0 type:kotlinx.serialization.encoding.Encoder - VALUE_PARAMETER GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:value index:1 type:.BoxService.$rpcServiceStub.test2$rpcMethod - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_28 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_29 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_28: 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_29: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null - serialDesc: GET_VAR 'val tmp_28: 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_29: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.test2$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null - descriptor: GET_VAR 'val tmp_28: 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:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=kotlin.Unit - 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.RpcMethodClass - $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 @@ -1087,11 +316,13 @@ FILE fqName: fileName:/customParameterTypes.kt : 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 (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, parameters: kotlin.Array, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion callableName: CONST String type=kotlin.String value="test1" - 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 + parameters: 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? + GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test1' type=.TestData 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.test1' type=.BoxService.$rpcServiceStub origin=null FUN name:test2 visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub, testData:.TestData) returnType:kotlin.String [suspend] @@ -1105,11 +336,13 @@ FILE fqName: fileName:/customParameterTypes.kt : 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 (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, parameters: kotlin.Array, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion callableName: CONST String type=kotlin.String value="test2" - 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 + parameters: 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? + GET_VAR 'testData: .TestData declared in .BoxService.$rpcServiceStub.test2' type=.TestData 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.test2' type=.BoxService.$rpcServiceStub origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt index 757864040..fac58f19c 100644 --- a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.fir.txt @@ -1,5 +1,5 @@ FILE: customParameterTypes.kt - @R|kotlinx/serialization/Serializable|() public final data class TestData : R|kotlin/Any| { + public final data class TestData : R|kotlin/Any| { public constructor(value: R|kotlin/String|): R|TestData| { super() } @@ -11,31 +11,6 @@ FILE: customParameterTypes.kt 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() - } - - } - } @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlin/Any| { public abstract suspend fun test1(testData: R|TestData|): R|kotlin/String| @@ -43,72 +18,6 @@ FILE: customParameterTypes.kt 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| { } diff --git a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt index ea977aaac..eb1505e9d 100644 --- a/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt +++ b/tests/compiler-plugin-tests/src/testData/box/customParameterTypes.kt @@ -4,12 +4,10 @@ import kotlinx.coroutines.flow.* import kotlinx.coroutines.runBlocking -import kotlinx.serialization.Serializable import kotlinx.rpc.withService import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.codegen.test.TestRpcClient -@Serializable data class TestData(val value: String) @Rpc 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 index 7caead7bc..473f3338c 100644 --- a/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.ir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.ir.txt @@ -49,21 +49,17 @@ FILE fqName: fileName:/flowParameter.kt EXPRESSION_BODY TYPE_OP type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=SAM_CONVERSION typeOperand=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> FUN_EXPR type=kotlin.coroutines.SuspendFunction2<.BoxService, kotlin.Any?, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, data:kotlin.Any?) returnType:kotlin.Any? [suspend] + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, parameters:kotlin.Array) returnType:kotlin.Any? [suspend] VALUE_PARAMETER name:service index:0 type:.BoxService - VALUE_PARAMETER name:data index:1 type:kotlin.Any? + VALUE_PARAMETER name:parameters index:1 type:kotlin.Array BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.BoxService.$rpcServiceStub.stream$rpcMethod [val] - CALL 'public final fun rpcInternalDataCast (methodName: kotlin.String, serviceName: kotlin.String): T of kotlinx.rpc.internal.rpcInternalDataCast declared in kotlinx.rpc.internal' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null - : .BoxService.$rpcServiceStub.stream$rpcMethod - $receiver: GET_VAR 'data: kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.streamInvokator.' type=kotlin.Any? origin=null - methodName: CONST String type=kotlin.String value="stream" - serviceName: CONST String type=kotlin.String value="BoxService" - RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, data: kotlin.Any?): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.streamInvokator' + RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, parameters: kotlin.Array): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.streamInvokator' CALL 'public abstract fun stream (flow: kotlinx.coroutines.flow.Flow): kotlin.String declared in .BoxService' type=kotlin.String origin=null $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.streamInvokator.' type=.BoxService origin=null - flow: 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 'val tmp_0: .BoxService.$rpcServiceStub.stream$rpcMethod declared in .BoxService.$rpcServiceStub.Companion.streamInvokator.' type=.BoxService.$rpcServiceStub.stream$rpcMethod origin=null + flow: TYPE_OP type=kotlinx.coroutines.flow.Flow origin=CAST typeOperand=kotlinx.coroutines.flow.Flow + CALL 'public final fun get (index: kotlin.Int): T of kotlin.Array declared in kotlin.Array' type=kotlin.Any? origin=GET_ARRAY_ELEMENT + $this: GET_VAR 'parameters: kotlin.Array declared in .BoxService.$rpcServiceStub.Companion.streamInvokator.' type=kotlin.Array origin=null + index: CONST Int type=kotlin.Int value=0 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> correspondingProperty: PROPERTY name:streamInvokator visibility:private modality:FINAL [val] $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion @@ -82,25 +78,28 @@ FILE fqName: fileName:/flowParameter.kt : kotlin.String : kotlinx.rpc.descriptor.RpcCallable<.BoxService> $receiver: CONST String type=kotlin.String value="stream" - that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, dataType: kotlinx.rpc.descriptor.RpcType, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallable' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null + that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallableDefault' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null : .BoxService name: CONST String type=kotlin.String value="stream" - dataType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null - kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null - : .BoxService.$rpcServiceStub.stream$rpcMethod - returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null + returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcTypeDefault' type=kotlinx.rpc.descriptor.RpcType origin=null kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null : kotlin.String + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : invokator: CALL 'private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=GET_PROPERTY $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion' type=.BoxService.$rpcServiceStub.Companion origin=null parameters: CALL 'public final fun arrayOf (vararg elements: T of kotlin.arrayOf): kotlin.Array declared in kotlin' type=kotlin.Array origin=null : kotlinx.rpc.descriptor.RpcParameter elements: VARARG type=kotlin.Array varargElementType=kotlinx.rpc.descriptor.RpcParameter - CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, type: kotlinx.rpc.descriptor.RpcType) declared in kotlinx.rpc.descriptor.RpcParameter' type=kotlinx.rpc.descriptor.RpcParameter origin=null + CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, type: kotlinx.rpc.descriptor.RpcType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcParameterDefault' type=kotlinx.rpc.descriptor.RpcParameter origin=null name: CONST String type=kotlin.String value="flow" - type: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null + type: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcTypeDefault' type=kotlinx.rpc.descriptor.RpcType origin=null kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null : kotlinx.coroutines.flow.Flow + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : isNonSuspendFunction: CONST Boolean type=kotlin.Boolean value=false FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlin.collections.Map.BoxService>> correspondingProperty: PROPERTY name:callableMap visibility:private modality:FINAL [val] @@ -148,328 +147,6 @@ FILE fqName: fileName:/flowParameter.kt $this: CALL 'private final fun (): kotlin.collections.Map.BoxService>> declared in .BoxService.$rpcServiceStub.Companion' type=kotlin.collections.Map.BoxService>> origin=GET_PROPERTY $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.getCallable' type=.BoxService.$rpcServiceStub.Companion origin=null key: GET_VAR 'name: kotlin.String declared in .BoxService.$rpcServiceStub.Companion.getCallable' type=kotlin.String origin=null - CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] CLASS name:stream$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass] - 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 - : kotlin.Lazy> - elements: VARARG type=kotlin.Array>> varargElementType=kotlin.Lazy> - 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.stream$rpcMethod.Companion.$childSerializers' - 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] declared in .BoxService.$rpcServiceStub.stream$rpcMethod.Companion' 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]' type=kotlin.Unit - 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 declared in kotlinx.serialization.internal.GeneratedSerializer - 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_1 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_1: 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_1: 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>]' type=kotlin.Unit - 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_2 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 abstract fun (): T of kotlin.Lazy declared in kotlin.Lazy' type=kotlinx.serialization.KSerializer origin=null - $this: 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_2: 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 GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:decoder index:0 type:kotlinx.serialization.encoding.Decoder - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_3 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_4 type:kotlin.Boolean [var] - CONST Boolean type=kotlin.Boolean value=true - 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:kotlin.Int [var] - CONST Int type=kotlin.Int value=0 - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlinx.coroutines.flow.Flow? [var] - CONST Null type=kotlinx.coroutines.flow.Flow? value=null - VAR IR_TEMPORARY_VARIABLE name:tmp_8 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_3: 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_9 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_8: 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_7: 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_8: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_3: 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 abstract fun (): T of kotlin.Lazy declared in kotlin.Lazy' type=kotlinx.serialization.KSerializer origin=null - $this: 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_9: 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_7: kotlinx.coroutines.flow.Flow? declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.coroutines.flow.Flow? origin=null - SET_VAR 'var tmp_6: 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_6: 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_4: 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_5: 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_8: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_3: 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_5: 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_4: 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_5: 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_7: 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_8: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_3: 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 abstract fun (): T of kotlin.Lazy declared in kotlin.Lazy' type=kotlinx.serialization.KSerializer origin=null - $this: 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_9: 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_7: kotlinx.coroutines.flow.Flow? declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.coroutines.flow.Flow? origin=null - SET_VAR 'var tmp_6: 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_6: 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_5: 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_8: kotlinx.serialization.encoding.CompositeDecoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlinx.serialization.encoding.CompositeDecoder origin=null - descriptor: GET_VAR 'val tmp_3: 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_6: kotlin.Int declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.deserialize' type=kotlin.Int origin=null - flow: GET_VAR 'var tmp_7: 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 GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:encoder index:0 type:kotlinx.serialization.encoding.Encoder - VALUE_PARAMETER GENERATED[org.jetbrains.kotlinx.serialization.compiler.fir.SerializationPluginKey] name:value index:1 type:.BoxService.$rpcServiceStub.stream$rpcMethod - BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_10 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_11 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_10: 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_11: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null - serialDesc: GET_VAR 'val tmp_10: 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_11: kotlinx.serialization.encoding.CompositeEncoder declared in .BoxService.$rpcServiceStub.stream$rpcMethod.$serializer.serialize' type=kotlinx.serialization.encoding.CompositeEncoder origin=null - descriptor: GET_VAR 'val tmp_10: 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:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=kotlin.Unit - 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_12 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 abstract fun (): T of kotlin.Lazy declared in kotlin.Lazy' type=kotlinx.serialization.KSerializer origin=null - $this: 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_12: 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.RpcMethodClass - $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 @@ -500,11 +177,13 @@ FILE fqName: fileName:/flowParameter.kt : 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 (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, parameters: kotlin.Array, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion callableName: CONST String type=kotlin.String value="stream" - 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 + parameters: 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? + GET_VAR 'flow: kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.stream' type=kotlinx.coroutines.flow.Flow 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.stream' type=.BoxService.$rpcServiceStub origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt index faa22955a..6d33d23bf 100644 --- a/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/flowParameter.fir.txt @@ -3,39 +3,6 @@ FILE: flowParameter.kt 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| { } diff --git a/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt b/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt index 054984b29..23884b3ff 100644 --- a/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt +++ b/tests/compiler-plugin-tests/src/testData/box/flowParameter.kt @@ -10,7 +10,6 @@ import kotlinx.rpc.codegen.test.TestRpcClient @Rpc interface BoxService { - // plugin should add @Contextual annotation to the flow parameter in the generated class suspend fun stream(flow: Flow): String } 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 index 2dc4375cf..872ba5a6d 100644 --- a/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.ir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.ir.txt @@ -50,17 +50,11 @@ FILE fqName: fileName:/module_lib_multiModule.kt EXPRESSION_BODY TYPE_OP type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=SAM_CONVERSION typeOperand=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> FUN_EXPR type=kotlin.coroutines.SuspendFunction2<.BoxService, kotlin.Any?, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, data:kotlin.Any?) returnType:kotlin.Any? [suspend] + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, parameters:kotlin.Array) returnType:kotlin.Any? [suspend] VALUE_PARAMETER name:service index:0 type:.BoxService - VALUE_PARAMETER name:data index:1 type:kotlin.Any? + VALUE_PARAMETER name:parameters index:1 type:kotlin.Array BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.BoxService.$rpcServiceStub.simple$rpcMethod [val] - CALL 'public final fun rpcInternalDataCast (methodName: kotlin.String, serviceName: kotlin.String): T of kotlinx.rpc.internal.rpcInternalDataCast declared in kotlinx.rpc.internal' type=.BoxService.$rpcServiceStub.simple$rpcMethod origin=null - : .BoxService.$rpcServiceStub.simple$rpcMethod - $receiver: GET_VAR 'data: kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.simpleInvokator.' type=kotlin.Any? origin=null - methodName: CONST String type=kotlin.String value="simple" - serviceName: CONST String type=kotlin.String value="BoxService" - RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, data: kotlin.Any?): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.simpleInvokator' + RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, parameters: kotlin.Array): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.simpleInvokator' CALL 'public abstract fun simple (): kotlin.String declared in .BoxService' type=kotlin.String origin=null $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.simpleInvokator.' type=.BoxService origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> @@ -81,15 +75,14 @@ FILE fqName: fileName:/module_lib_multiModule.kt : kotlin.String : kotlinx.rpc.descriptor.RpcCallable<.BoxService> $receiver: CONST String type=kotlin.String value="simple" - that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, dataType: kotlinx.rpc.descriptor.RpcType, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallable' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null + that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallableDefault' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null : .BoxService name: CONST String type=kotlin.String value="simple" - dataType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null - kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null - : .BoxService.$rpcServiceStub.simple$rpcMethod - returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null + returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcTypeDefault' type=kotlinx.rpc.descriptor.RpcType origin=null kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null : kotlin.String + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : invokator: CALL 'private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=GET_PROPERTY $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion' type=.BoxService.$rpcServiceStub.Companion origin=null parameters: CALL 'public final fun emptyArray (): kotlin.Array declared in kotlin' type=kotlin.Array origin=null @@ -141,69 +134,6 @@ FILE fqName: fileName:/module_lib_multiModule.kt $this: CALL 'private final fun (): kotlin.collections.Map.BoxService>> declared in .BoxService.$rpcServiceStub.Companion' type=kotlin.collections.Map.BoxService>> origin=GET_PROPERTY $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.getCallable' type=.BoxService.$rpcServiceStub.Companion origin=null key: GET_VAR 'name: kotlin.String declared in .BoxService.$rpcServiceStub.Companion.getCallable' type=kotlin.String origin=null - CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass] - 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] declared in .BoxService.$rpcServiceStub.simple$rpcMethod' 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:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' 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] declared in .BoxService.$rpcServiceStub.simple$rpcMethod' 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:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=kotlin.Unit - 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.RpcMethodClass - $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 @@ -233,10 +163,11 @@ FILE fqName: fileName:/module_lib_multiModule.kt : 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 (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, parameters: kotlin.Array, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion callableName: CONST String type=kotlin.String value="simple" - data: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=.BoxService.$rpcServiceStub.simple$rpcMethod + parameters: CALL 'public final fun emptyArray (): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Any? 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 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt index 41556d0b0..1f9fe5329 100644 --- a/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/multiModule.fir.txt @@ -4,15 +4,6 @@ FILE: module_lib_multiModule.kt 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| { } 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 index 15de1bff3..9d2e4b263 100644 --- a/tests/compiler-plugin-tests/src/testData/box/simple.fir.ir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/simple.fir.ir.txt @@ -49,17 +49,11 @@ FILE fqName: fileName:/simple.kt EXPRESSION_BODY TYPE_OP type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=SAM_CONVERSION typeOperand=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> FUN_EXPR type=kotlin.coroutines.SuspendFunction2<.BoxService, kotlin.Any?, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, data:kotlin.Any?) returnType:kotlin.Any? [suspend] + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService, parameters:kotlin.Array) returnType:kotlin.Any? [suspend] VALUE_PARAMETER name:service index:0 type:.BoxService - VALUE_PARAMETER name:data index:1 type:kotlin.Any? + VALUE_PARAMETER name:parameters index:1 type:kotlin.Array BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.BoxService.$rpcServiceStub.simple$rpcMethod [val] - CALL 'public final fun rpcInternalDataCast (methodName: kotlin.String, serviceName: kotlin.String): T of kotlinx.rpc.internal.rpcInternalDataCast declared in kotlinx.rpc.internal' type=.BoxService.$rpcServiceStub.simple$rpcMethod origin=null - : .BoxService.$rpcServiceStub.simple$rpcMethod - $receiver: GET_VAR 'data: kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.simpleInvokator.' type=kotlin.Any? origin=null - methodName: CONST String type=kotlin.String value="simple" - serviceName: CONST String type=kotlin.String value="BoxService" - RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, data: kotlin.Any?): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.simpleInvokator' + RETURN type=kotlin.Nothing from='local final fun (service: .BoxService, parameters: kotlin.Array): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.simpleInvokator' CALL 'public abstract fun simple (): kotlin.String declared in .BoxService' type=kotlin.String origin=null $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.simpleInvokator.' type=.BoxService origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> @@ -80,15 +74,14 @@ FILE fqName: fileName:/simple.kt : kotlin.String : kotlinx.rpc.descriptor.RpcCallable<.BoxService> $receiver: CONST String type=kotlin.String value="simple" - that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, dataType: kotlinx.rpc.descriptor.RpcType, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallable' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null + that: CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, returnType: kotlinx.rpc.descriptor.RpcType, invokator: kotlinx.rpc.descriptor.RpcInvokator, parameters: kotlin.Array, isNonSuspendFunction: kotlin.Boolean) declared in kotlinx.rpc.descriptor.RpcCallableDefault' type=kotlinx.rpc.descriptor.RpcCallable<.BoxService> origin=null : .BoxService name: CONST String type=kotlin.String value="simple" - dataType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null - kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null - : .BoxService.$rpcServiceStub.simple$rpcMethod - returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType) declared in kotlinx.rpc.descriptor.RpcType' type=kotlinx.rpc.descriptor.RpcType origin=null + returnType: CONSTRUCTOR_CALL 'public constructor (kType: kotlin.reflect.KType, annotations: kotlin.collections.List) declared in kotlinx.rpc.descriptor.RpcTypeDefault' type=kotlinx.rpc.descriptor.RpcType origin=null kType: CALL 'public final fun typeOf (): kotlin.reflect.KType declared in kotlin.reflect' type=kotlin.reflect.KType origin=null : kotlin.String + annotations: CALL 'public final fun emptyList (): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null + : invokator: CALL 'private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' type=kotlinx.rpc.descriptor.RpcInvokator.Method<.BoxService> origin=GET_PROPERTY $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion' type=.BoxService.$rpcServiceStub.Companion origin=null parameters: CALL 'public final fun emptyArray (): kotlin.Array declared in kotlin' type=kotlin.Array origin=null @@ -140,69 +133,6 @@ FILE fqName: fileName:/simple.kt $this: CALL 'private final fun (): kotlin.collections.Map.BoxService>> declared in .BoxService.$rpcServiceStub.Companion' type=kotlin.collections.Map.BoxService>> origin=GET_PROPERTY $this: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.getCallable' type=.BoxService.$rpcServiceStub.Companion origin=null key: GET_VAR 'name: kotlin.String declared in .BoxService.$rpcServiceStub.Companion.getCallable' type=kotlin.String origin=null - CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass] - 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] declared in .BoxService.$rpcServiceStub.simple$rpcMethod' 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:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' 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] declared in .BoxService.$rpcServiceStub.simple$rpcMethod' 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:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=kotlin.Unit - 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.RpcMethodClass - $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 @@ -232,10 +162,11 @@ FILE fqName: fileName:/simple.kt : 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 (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, data: kotlin.Any, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null + call: CONSTRUCTOR_CALL 'public constructor (descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, callableName: kotlin.String, parameters: kotlin.Array, serviceId: kotlin.Long) declared in kotlinx.rpc.RpcCall' type=kotlinx.rpc.RpcCall origin=null descriptor: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' type=.BoxService.$rpcServiceStub.Companion callableName: CONST String type=kotlin.String value="simple" - data: GET_OBJECT 'CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedRpcMethodClassKey] OBJECT name:simple$rpcMethod modality:FINAL visibility:public superTypes:[kotlin.Any; kotlinx.rpc.internal.RpcMethodClass]' type=.BoxService.$rpcServiceStub.simple$rpcMethod + parameters: CALL 'public final fun emptyArray (): kotlin.Array declared in kotlin' type=kotlin.Array origin=null + : kotlin.Any? 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 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt b/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt index 51cb78524..833e1beb3 100644 --- a/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/box/simple.fir.txt @@ -3,15 +3,6 @@ FILE: simple.kt 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| { } diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.fir.txt b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.fir.txt index 808bf3735..1e5c8a8c1 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.fir.txt @@ -20,90 +20,6 @@ FILE: rpcService.kt public abstract suspend fun sameName2(a: R|kotlin/Int|): R|kotlin/Unit| public final class $rpcServiceStub : R|kotlin/Any| { - @R|kotlinx/serialization/Serializable|() public final object hello$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.hello$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final class generic$rpcMethod : R|kotlin/Any| { - public final val a: R|T| - public get(): R|T| - - public constructor(a: R|T|): R|MyService.$rpcServiceStub.generic$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.generic$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|MyService.$rpcServiceStub.generic$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.generic$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|MyService.$rpcServiceStub.generic$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class generic2$rpcMethod : R|kotlin/Any| { - public final val a: R|T| - public get(): R|T| - - public final val b: R|kotlin/Int| - public get(): R|kotlin/Int| - - public final val c: R|T4| - public get(): R|T4| - - public final val t2: R|T2| - public get(): R|T2| - - public constructor(a: R|T|, b: R|kotlin/Int|, c: R|T4|, t2: R|T2|): R|MyService.$rpcServiceStub.generic2$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.generic2$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|MyService.$rpcServiceStub.generic2$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.generic2$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|MyService.$rpcServiceStub.generic2$rpcMethod.$serializer| { - super() - } - - } - - } - public final companion object Companion : R|kotlin/Any| { } diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.kt b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.kt index 02c13640d..30bc196f8 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.kt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcService.kt @@ -7,8 +7,6 @@ import kotlin.coroutines.* import kotlinx.coroutines.* import kotlinx.coroutines.flow.* -import kotlinx.serialization.Serializable -import kotlinx.serialization.Contextual import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.internal.utils.ExperimentalRpcApi diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.fir.txt b/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.fir.txt index cf4fea132..28defc553 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.fir.txt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.fir.txt @@ -1,44 +1,19 @@ FILE: b.kt @FILE:R|kotlin/OptIn|(markerClass = vararg((Q|kotlinx/rpc/internal/utils/ExperimentalRpcApi|))) - @R|kotlinx/serialization/Serializable|() public final data class InnerFlow : R|kotlin/Any| { - public constructor(flow: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow|): R|InnerFlow| { + public final data class InnerFlow : R|kotlin/Any| { + public constructor(flow: R|kotlinx/coroutines/flow/Flow|): R|InnerFlow| { super() } - public final val flow: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| = R|/flow| - public get(): R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| - - public final operator fun component1(): R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| - - public final fun copy(flow: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| = this@R|/InnerFlow|.R|/InnerFlow.flow|): R|InnerFlow| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|InnerFlow.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|InnerFlow|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|InnerFlow| - - public final val descriptor: R|kotlinx/serialization/descriptors/SerialDescriptor| - public get(): R|kotlinx/serialization/descriptors/SerialDescriptor| - - public final override fun childSerializers(): R|kotlin/Array>| + public final val flow: R|kotlinx/coroutines/flow/Flow| = R|/flow| + public get(): R|kotlinx/coroutines/flow/Flow| - private constructor(): R|InnerFlow.$serializer| { - super() - } + public final operator fun component1(): R|kotlinx/coroutines/flow/Flow| - } + public final fun copy(flow: R|kotlinx/coroutines/flow/Flow| = this@R|/InnerFlow|.R|/InnerFlow.flow|): R|InnerFlow| } - @R|kotlinx/serialization/Serializable|() public final data class Wrapper : R|kotlin/Any| { + public final data class Wrapper : R|kotlin/Any| { public constructor(inner: R|T|): R|Wrapper| { super() } @@ -50,82 +25,28 @@ FILE: b.kt public final fun copy(inner: R|T| = this@R|/Wrapper|.R|/Wrapper.inner|): R|Wrapper| - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(typeSerial0: R|kotlinx/serialization/KSerializer|): R|kotlinx/serialization/KSerializer>| - - private constructor(): R|Wrapper.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 class $serializer : R|kotlinx/serialization/internal/GeneratedSerializer>| { - public final override fun serialize(encoder: R|kotlinx/serialization/encoding/Encoder|, value: R|Wrapper|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|Wrapper| - - public final val descriptor: R|kotlinx/serialization/descriptors/SerialDescriptor| - public get(): R|kotlinx/serialization/descriptors/SerialDescriptor| - - public final override fun childSerializers(): R|kotlin/Array>| - - public final override fun typeParametersSerializers(): R|kotlin/Array>| - - private constructor(): R|Wrapper.$serializer| { - super() - } - - public constructor(typeSerial0: R|kotlinx/serialization/KSerializer|): R|Wrapper.$serializer| - - } - } - @R|kotlinx/serialization/Serializable|() public final data class MultiFlow : R|kotlin/Any| { - public constructor(flow1: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow|, flow2: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow|, flow3: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow|): R|MultiFlow| { + public final data class MultiFlow : R|kotlin/Any| { + public constructor(flow1: R|kotlinx/coroutines/flow/Flow|, flow2: R|kotlinx/coroutines/flow/Flow|, flow3: R|kotlinx/coroutines/flow/Flow|): R|MultiFlow| { super() } - public final val flow1: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| = R|/flow1| - public get(): R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| - - public final val flow2: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| = R|/flow2| - public get(): R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| - - public final val flow3: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| = R|/flow3| - public get(): R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| - - public final operator fun component1(): R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| - - public final operator fun component2(): R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| - - public final operator fun component3(): R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| - - public final fun copy(flow1: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| = this@R|/MultiFlow|.R|/MultiFlow.flow1|, flow2: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| = this@R|/MultiFlow|.R|/MultiFlow.flow2|, flow3: R|@R|kotlinx/serialization/Contextual|() kotlinx/coroutines/flow/Flow| = this@R|/MultiFlow|.R|/MultiFlow.flow3|): R|MultiFlow| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MultiFlow.Companion| { - super() - } - - } + public final val flow1: R|kotlinx/coroutines/flow/Flow| = R|/flow1| + public get(): R|kotlinx/coroutines/flow/Flow| - @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|MultiFlow|): R|kotlin/Unit| + public final val flow2: R|kotlinx/coroutines/flow/Flow| = R|/flow2| + public get(): R|kotlinx/coroutines/flow/Flow| - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MultiFlow| + public final val flow3: R|kotlinx/coroutines/flow/Flow| = R|/flow3| + public get(): R|kotlinx/coroutines/flow/Flow| - public final val descriptor: R|kotlinx/serialization/descriptors/SerialDescriptor| - public get(): R|kotlinx/serialization/descriptors/SerialDescriptor| + public final operator fun component1(): R|kotlinx/coroutines/flow/Flow| - public final override fun childSerializers(): R|kotlin/Array>| + public final operator fun component2(): R|kotlinx/coroutines/flow/Flow| - private constructor(): R|MultiFlow.$serializer| { - super() - } + public final operator fun component3(): R|kotlinx/coroutines/flow/Flow| - } + public final fun copy(flow1: R|kotlinx/coroutines/flow/Flow| = this@R|/MultiFlow|.R|/MultiFlow.flow1|, flow2: R|kotlinx/coroutines/flow/Flow| = this@R|/MultiFlow|.R|/MultiFlow.flow2|, flow3: R|kotlinx/coroutines/flow/Flow| = this@R|/MultiFlow|.R|/MultiFlow.flow3|): R|MultiFlow| } @R|kotlinx/rpc/annotations/Rpc|() public abstract interface MyService : R|kotlin/Any| { @@ -185,513 +106,6 @@ FILE: b.kt public abstract fun nonSuspendNoFlowString(): R|kotlin/String| public final class $rpcServiceStub : R|kotlin/Any| { - @R|kotlinx/serialization/Serializable|() public final class state$rpcMethod : R|kotlin/Any| { - @R|kotlinx/serialization/Contextual|() public final val flow: R|kotlinx/coroutines/flow/StateFlow| - public get(): R|kotlinx/coroutines/flow/StateFlow| - - public constructor(flow: R|kotlinx/coroutines/flow/StateFlow|): R|MyService.$rpcServiceStub.state$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.state$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|MyService.$rpcServiceStub.state$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.state$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|MyService.$rpcServiceStub.state$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class shared$rpcMethod : R|kotlin/Any| { - @R|kotlinx/serialization/Contextual|() public final val flow: R|kotlinx/coroutines/flow/SharedFlow| - public get(): R|kotlinx/coroutines/flow/SharedFlow| - - public constructor(flow: R|kotlinx/coroutines/flow/SharedFlow|): R|MyService.$rpcServiceStub.shared$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.shared$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|MyService.$rpcServiceStub.shared$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.shared$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|MyService.$rpcServiceStub.shared$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class deepState$rpcMethod : R|kotlin/Any| { - public final val flow: R|Wrapper>| - public get(): R|Wrapper>| - - public constructor(flow: R|Wrapper>|): R|MyService.$rpcServiceStub.deepState$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.deepState$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|MyService.$rpcServiceStub.deepState$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.deepState$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|MyService.$rpcServiceStub.deepState$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class deepShared$rpcMethod : R|kotlin/Any| { - public final val flow: R|Wrapper>| - public get(): R|Wrapper>| - - public constructor(flow: R|Wrapper>|): R|MyService.$rpcServiceStub.deepShared$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.deepShared$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|MyService.$rpcServiceStub.deepShared$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.deepShared$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|MyService.$rpcServiceStub.deepShared$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class flowOk$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|MyService.$rpcServiceStub.flowOk$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.flowOk$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|MyService.$rpcServiceStub.flowOk$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.flowOk$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|MyService.$rpcServiceStub.flowOk$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final object serverFlowOk$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.serverFlowOk$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final object serverFlowFail$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.serverFlowFail$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final object notTopLevelServerFlow$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.notTopLevelServerFlow$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final object wrappedNotTopLevelServerFlow$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.wrappedNotTopLevelServerFlow$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final object wrappedALot$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.wrappedALot$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final object wrappedALotFlow$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.wrappedALotFlow$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final class notTopLevelClientFlow$rpcMethod : R|kotlin/Any| { - public final val flow: R|InnerFlow| - public get(): R|InnerFlow| - - public constructor(flow: R|InnerFlow|): R|MyService.$rpcServiceStub.notTopLevelClientFlow$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.notTopLevelClientFlow$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|MyService.$rpcServiceStub.notTopLevelClientFlow$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.notTopLevelClientFlow$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|MyService.$rpcServiceStub.notTopLevelClientFlow$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final object nestedServerFlow$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.nestedServerFlow$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final object nestedServerTrickyFlow$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.nestedServerTrickyFlow$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final object serverMultiFlow$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.serverMultiFlow$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final class clientMultiFlow$rpcMethod : R|kotlin/Any| { - public final val flow: R|MultiFlow| - public get(): R|MultiFlow| - - public constructor(flow: R|MultiFlow|): R|MyService.$rpcServiceStub.clientMultiFlow$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.clientMultiFlow$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|MyService.$rpcServiceStub.clientMultiFlow$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.clientMultiFlow$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|MyService.$rpcServiceStub.clientMultiFlow$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class clientMultiFlowMany$rpcMethod : R|kotlin/Any| { - public final val flow: R|MultiFlow| - public get(): R|MultiFlow| - - public final val flow2: R|MultiFlow| - public get(): R|MultiFlow| - - public final val flow3: R|MultiFlow| - public get(): R|MultiFlow| - - public constructor(flow: R|MultiFlow|, flow2: R|MultiFlow|, flow3: R|MultiFlow|): R|MyService.$rpcServiceStub.clientMultiFlowMany$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.clientMultiFlowMany$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|MyService.$rpcServiceStub.clientMultiFlowMany$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.clientMultiFlowMany$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|MyService.$rpcServiceStub.clientMultiFlowMany$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class clientMultiFlowPlain$rpcMethod : R|kotlin/Any| { - @R|kotlinx/serialization/Contextual|() public final val flow: R|kotlinx/coroutines/flow/Flow| - public get(): R|kotlinx/coroutines/flow/Flow| - - @R|kotlinx/serialization/Contextual|() public final val flow2: R|kotlinx/coroutines/flow/Flow| - public get(): R|kotlinx/coroutines/flow/Flow| - - @R|kotlinx/serialization/Contextual|() public final val flow3: R|kotlinx/coroutines/flow/Flow| - public get(): R|kotlinx/coroutines/flow/Flow| - - public constructor(flow: R|kotlinx/coroutines/flow/Flow|, flow2: R|kotlinx/coroutines/flow/Flow|, flow3: R|kotlinx/coroutines/flow/Flow|): R|MyService.$rpcServiceStub.clientMultiFlowPlain$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.clientMultiFlowPlain$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|MyService.$rpcServiceStub.clientMultiFlowPlain$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.clientMultiFlowPlain$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|MyService.$rpcServiceStub.clientMultiFlowPlain$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class clientInnerFlow$rpcMethod : R|kotlin/Any| { - public final val inner: R|InnerFlow| - public get(): R|InnerFlow| - - public constructor(inner: R|InnerFlow|): R|MyService.$rpcServiceStub.clientInnerFlow$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.clientInnerFlow$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|MyService.$rpcServiceStub.clientInnerFlow$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.clientInnerFlow$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|MyService.$rpcServiceStub.clientInnerFlow$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class clientNestedFlow$rpcMethod : R|kotlin/Any| { - @R|kotlinx/serialization/Contextual|() public final val inner: R|kotlinx/coroutines/flow/Flow>| - public get(): R|kotlinx/coroutines/flow/Flow>| - - public constructor(inner: R|kotlinx/coroutines/flow/Flow>|): R|MyService.$rpcServiceStub.clientNestedFlow$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.clientNestedFlow$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|MyService.$rpcServiceStub.clientNestedFlow$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.clientNestedFlow$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|MyService.$rpcServiceStub.clientNestedFlow$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final class clientNestedTrickyFlow$rpcMethod : R|kotlin/Any| { - public final val inner: R|Wrapper>>>| - public get(): R|Wrapper>>>| - - public constructor(inner: R|Wrapper>>>|): R|MyService.$rpcServiceStub.clientNestedTrickyFlow$rpcMethod| - - public final companion object Companion : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.clientNestedTrickyFlow$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|MyService.$rpcServiceStub.clientNestedTrickyFlow$rpcMethod|): R|kotlin/Unit| - - public final override fun deserialize(decoder: R|kotlinx/serialization/encoding/Decoder|): R|MyService.$rpcServiceStub.clientNestedTrickyFlow$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|MyService.$rpcServiceStub.clientNestedTrickyFlow$rpcMethod.$serializer| { - super() - } - - } - - } - - @R|kotlinx/serialization/Serializable|() public final object nonSuspendNoFlow$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.nonSuspendNoFlow$rpcMethod| { - super() - } - - } - - @R|kotlinx/serialization/Serializable|() public final object nonSuspendNoFlowString$rpcMethod : R|kotlin/Any| { - public final fun serializer(): R|kotlinx/serialization/KSerializer| - - private constructor(): R|MyService.$rpcServiceStub.nonSuspendNoFlowString$rpcMethod| { - super() - } - - } - public final companion object Companion : R|kotlin/Any| { } diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.kt b/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.kt index 4b747e00b..eddd9e2f2 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.kt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/strictMode.kt @@ -10,26 +10,21 @@ import kotlin.coroutines.* import kotlinx.coroutines.* import kotlinx.coroutines.flow.* -import kotlinx.serialization.Serializable -import kotlinx.serialization.Contextual import kotlinx.rpc.annotations.Rpc import kotlinx.rpc.internal.utils.ExperimentalRpcApi -@Serializable data class InnerFlow( - val flow: @Contextual Flow, + val flow: Flow, ) -@Serializable data class Wrapper( val inner: T, ) -@Serializable data class MultiFlow( - val flow1: @Contextual Flow, - val flow2: @Contextual Flow, - val flow3: @Contextual Flow, + val flow1: Flow, + val flow2: Flow, + val flow3: Flow, ) @Rpc From 92180071f9cd3ede3abb10c516d9352569ae89d6 Mon Sep 17 00:00:00 2001 From: Alexander Sysoev Date: Fri, 13 Jun 2025 21:39:53 +0200 Subject: [PATCH 4/4] Fix all compiler versions --- .../kotlinx/rpc/codegen/VersionSpecificApi.kt | 8 + .../rpc/codegen/extension/RpcStubGenerator.kt | 11 +- .../rpc/codegen/VersionSpecificApiImpl.kt | 13 ++ .../rpc/codegen/VersionSpecificApiImpl.kt | 14 ++ .../rpc/codegen/VersionSpecificApiImpl.kt | 14 ++ .../codegen/RpcIrServiceProcessorDelegate.kt | 21 ++ .../rpc/codegen/VersionSpecificApiImpl.kt | 184 ++++++++++++++++++ .../rpc/codegen/VersionSpecificApiImpl.kt | 13 ++ .../rpc/codegen/FirVersionSpecificApi.kt | 4 + .../checkers/SerializableProperties.kt | 18 +- .../rpc/codegen/FirVersionSpecificApiImpl.kt | 10 + .../rpc/codegen/FirVersionSpecificApiImpl.kt | 10 + .../rpc/codegen/FirVersionSpecificApiImpl.kt | 10 + .../rpc/codegen/FirVersionSpecificApiImpl.kt | 10 + .../rpc/codegen/FirVersionSpecificApiImpl.kt | 10 + .../diagnostics/DiagnosticFactories.kt | 50 ----- krpc/krpc-test/build.gradle.kts | 1 - versions-root/libs.versions.toml | 2 +- 18 files changed, 338 insertions(+), 65 deletions(-) create mode 100644 compiler-plugin/compiler-plugin-backend/src/main/pre_2_1_10/kotlinx/rpc/codegen/RpcIrServiceProcessorDelegate.kt create mode 100644 compiler-plugin/compiler-plugin-backend/src/main/pre_2_1_10/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt delete mode 100644 compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/checkers/diagnostics/DiagnosticFactories.kt diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/VersionSpecificApi.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/VersionSpecificApi.kt index dcd7ccc00..6bc90b461 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/VersionSpecificApi.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/VersionSpecificApi.kt @@ -14,6 +14,8 @@ import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.ir.builders.declarations.IrFieldBuilder import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.expressions.IrConstructorCall +import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl @@ -53,6 +55,12 @@ interface VersionSpecificApi { var IrConstructor.isPrimaryVS: Boolean + val IrConstructor.parametersVS: List + + val IrConstructorCall.argumentsVS: List + + fun IrType.isNullableVS(): Boolean + val messageCollectorKey: CompilerConfigurationKey companion object { 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 b5fce6706..005722a13 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 @@ -22,7 +22,6 @@ import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrSymbol import org.jetbrains.kotlin.ir.symbols.IrValueSymbol import org.jetbrains.kotlin.ir.types.* -import org.jetbrains.kotlin.ir.util.isNullable import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames @@ -603,7 +602,7 @@ internal class RpcStubGenerator( } } - if (arg.type.isNullable()) { + if (vsApi { arg.type.isNullableVS() }) { +irSafeAs(parameter, arg.type) } else { +irAs(parameter, arg.type) @@ -1061,7 +1060,7 @@ internal class RpcStubGenerator( elements = type.annotations .filter { it.type.isSerializableAnnotation() } .memoryOptimizedMap { - val kClassValue = it.arguments.singleOrNull() + val kClassValue = vsApi { it.argumentsVS }.singleOrNull() as? IrClassReference ?: error("Expected single not null value parameter of KSerializer::class for @Serializable annotation on type '${type.dumpKotlinLike()}'") @@ -1076,7 +1075,7 @@ internal class RpcStubGenerator( private fun IrType.irCreateInstance(): IrExpression { val classSymbol = - classOrNull ?: error("Expected class type for type to create instance '${type.dumpKotlinLike()}'") + classOrNull ?: error("Expected class type for type to create instance '${dumpKotlinLike()}'") return if (classSymbol.owner.isObject) { IrGetObjectValueImpl( @@ -1089,10 +1088,10 @@ internal class RpcStubGenerator( val constructor = classSymbol.owner.primaryConstructor ?: error("Expected primary constructor for a serializer '${dumpKotlinLike()}'") - if (constructor.parameters.isNotEmpty()) { + if (vsApi { constructor.parametersVS.isNotEmpty() }) { error( "Primary constructor for a serializer '${dumpKotlinLike()}' can't have parameters: " + - constructor.parameters.joinToString { it.dumpKotlinLike() } + vsApi { constructor.parametersVS }.joinToString { it.dumpKotlinLike() } ) } diff --git a/compiler-plugin/compiler-plugin-backend/src/main/latest/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-backend/src/main/latest/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt index 05bf28a78..fc2768863 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/latest/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/latest/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt @@ -15,6 +15,8 @@ import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.ir.builders.declarations.IrFieldBuilder import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.expressions.IrConstructorCall +import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl @@ -23,6 +25,7 @@ import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.util.copyTo +import org.jetbrains.kotlin.ir.util.isNullable import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName @@ -58,6 +61,16 @@ object VersionSpecificApiImpl : VersionSpecificApi { isPrimary = value } + override val IrConstructor.parametersVS: List + get() = parameters + + override val IrConstructorCall.argumentsVS: List + get() = arguments + + override fun IrType.isNullableVS(): Boolean { + return isNullable() + } + override fun referenceClass(context: IrPluginContext, packageName: String, name: String): IrClassSymbol? { return context.referenceClass( ClassId( diff --git a/compiler-plugin/compiler-plugin-backend/src/main/pre_2_0_10/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-backend/src/main/pre_2_0_10/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt index d574b9c9b..b5ab49638 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/pre_2_0_10/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/pre_2_0_10/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt @@ -12,9 +12,12 @@ import org.jetbrains.kotlin.cli.common.CLIConfigurationKeys import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.config.CompilerConfigurationKey import org.jetbrains.kotlin.descriptors.SourceElement +import org.jetbrains.kotlin.ir.backend.js.utils.valueArguments import org.jetbrains.kotlin.ir.builders.declarations.IrFieldBuilder import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.expressions.IrConstructorCall +import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl @@ -22,6 +25,7 @@ import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.isNullable import org.jetbrains.kotlin.ir.util.copyTo import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.ClassId @@ -56,6 +60,16 @@ object VersionSpecificApiImpl : VersionSpecificApi { isPrimary = value } + override val IrConstructor.parametersVS: List + get() = valueParameters + + override val IrConstructorCall.argumentsVS: List + get() = valueArguments + + override fun IrType.isNullableVS(): Boolean { + return isNullable() + } + override fun referenceClass(context: IrPluginContext, packageName: String, name: String): IrClassSymbol? { return context.referenceClass( ClassId( diff --git a/compiler-plugin/compiler-plugin-backend/src/main/pre_2_0_21/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-backend/src/main/pre_2_0_21/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt index 8b59920e6..4c8dd5077 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/pre_2_0_21/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/pre_2_0_21/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt @@ -11,9 +11,12 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector import org.jetbrains.kotlin.config.CommonConfigurationKeys import org.jetbrains.kotlin.config.CompilerConfigurationKey import org.jetbrains.kotlin.descriptors.SourceElement +import org.jetbrains.kotlin.ir.backend.js.utils.valueArguments import org.jetbrains.kotlin.ir.builders.declarations.IrFieldBuilder import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.expressions.IrConstructorCall +import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl @@ -22,6 +25,7 @@ import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.isNullable import org.jetbrains.kotlin.ir.util.copyTo import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.ClassId @@ -56,6 +60,16 @@ object VersionSpecificApiImpl : VersionSpecificApi { isPrimary = value } + override val IrConstructor.parametersVS: List + get() = valueParameters + + override val IrConstructorCall.argumentsVS: List + get() = valueArguments + + override fun IrType.isNullableVS(): Boolean { + return isNullable() + } + override fun referenceClass(context: IrPluginContext, packageName: String, name: String): IrClassSymbol? { return context.referenceClass( ClassId( diff --git a/compiler-plugin/compiler-plugin-backend/src/main/pre_2_1_10/kotlinx/rpc/codegen/RpcIrServiceProcessorDelegate.kt b/compiler-plugin/compiler-plugin-backend/src/main/pre_2_1_10/kotlinx/rpc/codegen/RpcIrServiceProcessorDelegate.kt new file mode 100644 index 000000000..0b9c1f0ac --- /dev/null +++ b/compiler-plugin/compiler-plugin-backend/src/main/pre_2_1_10/kotlinx/rpc/codegen/RpcIrServiceProcessorDelegate.kt @@ -0,0 +1,21 @@ +/* + * Copyright 2023-2025 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.RpcIrContext +import kotlinx.rpc.codegen.extension.RpcIrServiceProcessor +import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.declarations.IrClass +import org.jetbrains.kotlin.ir.visitors.IrElementTransformer + +internal class RpcIrServiceProcessorDelegate( + val processor: RpcIrServiceProcessor, +) : IrElementTransformer { + override fun visitClass(declaration: IrClass, data: RpcIrContext): IrStatement { + processor.visitClass(declaration, data) + + return super.visitClass(declaration, data) + } +} diff --git a/compiler-plugin/compiler-plugin-backend/src/main/pre_2_1_10/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-backend/src/main/pre_2_1_10/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt new file mode 100644 index 000000000..e1327fed3 --- /dev/null +++ b/compiler-plugin/compiler-plugin-backend/src/main/pre_2_1_10/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt @@ -0,0 +1,184 @@ +/* + * 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.IrMemberAccessExpressionData +import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression +import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext +import org.jetbrains.kotlin.backend.common.ir.addExtensionReceiver +import org.jetbrains.kotlin.cli.common.messages.MessageCollector +import org.jetbrains.kotlin.config.CommonConfigurationKeys +import org.jetbrains.kotlin.config.CompilerConfigurationKey +import org.jetbrains.kotlin.descriptors.SourceElement +import org.jetbrains.kotlin.ir.backend.js.utils.valueArguments +import org.jetbrains.kotlin.ir.builders.declarations.IrFieldBuilder +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.expressions.IrConstructorCall +import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin +import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl +import org.jetbrains.kotlin.ir.expressions.impl.IrConstructorCallImpl +import org.jetbrains.kotlin.ir.symbols.IrClassSymbol +import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol +import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol +import org.jetbrains.kotlin.ir.types.IrType +import org.jetbrains.kotlin.ir.types.isNullable +import org.jetbrains.kotlin.ir.util.copyTo +import org.jetbrains.kotlin.name.CallableId +import org.jetbrains.kotlin.name.ClassId +import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.platform.TargetPlatform +import org.jetbrains.kotlin.platform.isJs +import org.jetbrains.kotlin.platform.isWasm + +object VersionSpecificApiImpl : VersionSpecificApi { + override fun isJs(platform: TargetPlatform?): Boolean { + return platform.isJs() + } + + override fun isWasm(platform: TargetPlatform?): Boolean { + return platform.isWasm() + } + + override var IrFieldBuilder.isFinalVS: Boolean + get() = isFinal + set(value) { + isFinal = value + } + + override var IrCall.originVS: IrStatementOrigin? + get() = origin + set(value) { + origin = value + } + + override var IrConstructor.isPrimaryVS: Boolean + get() = isPrimary + set(value) { + isPrimary = value + } + + override val IrConstructor.parametersVS: List + get() = valueParameters + + override val IrConstructorCall.argumentsVS: List + get() = valueArguments + + override fun IrType.isNullableVS(): Boolean { + return isNullable() + } + + override fun referenceClass(context: IrPluginContext, packageName: String, name: String): IrClassSymbol? { + return context.referenceClass( + ClassId( + FqName(packageName), + FqName(name), + false + ) + ) + } + + override fun referenceFunctions( + context: IrPluginContext, + packageName: String, + name: String, + ): Collection { + return context.referenceFunctions( + CallableId( + FqName(packageName), + Name.identifier(name), + ) + ) + } + + override fun IrValueParameter.copyToVS(irFunction: IrFunction, origin: IrDeclarationOrigin): IrValueParameter { + return copyTo(irFunction, origin) + } + + override fun IrSimpleFunction.addExtensionReceiverVS(type: IrType, origin: IrDeclarationOrigin): IrValueParameter { + return addExtensionReceiver(type, origin) + } + + override val messageCollectorKey: CompilerConfigurationKey + get() = CommonConfigurationKeys.MESSAGE_COLLECTOR_KEY + + override fun IrCallImplVS( + startOffset: Int, + endOffset: Int, + type: IrType, + symbol: IrSimpleFunctionSymbol, + typeArgumentsCount: Int, + valueArgumentsCount: Int, + origin: IrStatementOrigin?, + superQualifierSymbol: IrClassSymbol?, + ): IrCallImpl { + return IrCallImpl( + startOffset = startOffset, + endOffset = endOffset, + type = type, + symbol = symbol, + typeArgumentsCount = typeArgumentsCount, + origin = origin, + superQualifierSymbol = superQualifierSymbol, + ) + } + + override fun IrConstructorCallImplVS( + startOffset: Int, + endOffset: Int, + type: IrType, + symbol: IrConstructorSymbol, + typeArgumentsCount: Int, + valueArgumentsCount: Int, + constructorTypeArgumentsCount: Int, + origin: IrStatementOrigin?, + source: SourceElement, + ): IrConstructorCallImpl { + return IrConstructorCallImpl( + startOffset = startOffset, + endOffset = endOffset, + type = type, + symbol = symbol, + typeArgumentsCount = typeArgumentsCount, + constructorTypeArgumentsCount = constructorTypeArgumentsCount, + origin = origin, + source = source, + ) + } + + override fun IrFunction.valueParametersVS(): List { + return valueParameters + } + + override val IrFunction.extensionReceiverParameterVS: IrValueParameter? + get() = extensionReceiverParameter + + override var IrFunction.dispatchReceiverParameterVS: IrValueParameter? + get() = dispatchReceiverParameter + set(value) { + dispatchReceiverParameter = value + } + + + override fun IrMemberAccessExpressionData.buildFor(access: IrMemberAccessExpression<*>) { + if (dispatchReceiver != null) { + access.dispatchReceiver = dispatchReceiver + } + + if (extensionReceiver != null) { + access.extensionReceiver = extensionReceiver + } + + valueArguments.forEachIndexed { index, irExpression -> + access.putValueArgument(index, irExpression) + } + + typeArguments.forEachIndexed { index, irType -> + access.putTypeArgument(index, irType) + } + } +} diff --git a/compiler-plugin/compiler-plugin-backend/src/main/v_2_2/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-backend/src/main/v_2_2/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt index 852c57eef..7fa1298f0 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/v_2_2/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/v_2_2/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt @@ -14,6 +14,8 @@ import org.jetbrains.kotlin.descriptors.SourceElement import org.jetbrains.kotlin.ir.builders.declarations.IrFieldBuilder import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrCall +import org.jetbrains.kotlin.ir.expressions.IrConstructorCall +import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl @@ -23,6 +25,7 @@ import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.util.copyTo +import org.jetbrains.kotlin.ir.util.isNullable import org.jetbrains.kotlin.name.CallableId import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName @@ -58,6 +61,16 @@ object VersionSpecificApiImpl : VersionSpecificApi { isPrimary = value } + override val IrConstructor.parametersVS: List + get() = parameters + + override val IrConstructorCall.argumentsVS: List + get() = arguments.toList() + + override fun IrType.isNullableVS(): Boolean { + return isNullable() + } + override fun referenceClass(context: IrPluginContext, packageName: String, name: String): IrClassSymbol? { return context.referenceClass( ClassId( diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirVersionSpecificApi.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirVersionSpecificApi.kt index ae9b9ed22..0edbec959 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirVersionSpecificApi.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/FirVersionSpecificApi.kt @@ -36,6 +36,10 @@ interface FirVersionSpecificApi { fun FirRegularClass.declarationsVS(session: FirSession): List> val FirResolvedTypeRef.coneTypeVS: ConeKotlinType + + fun FirTypeRef.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? + + fun ConeKotlinType.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? } inline fun vsApi(body: FirVersionSpecificApi.() -> T): T { diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/SerializableProperties.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/SerializableProperties.kt index 9ede91b2b..a2e8aa495 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/SerializableProperties.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/checkers/SerializableProperties.kt @@ -5,10 +5,10 @@ package kotlinx.rpc.codegen.checkers import kotlinx.rpc.codegen.common.RpcClassId +import kotlinx.rpc.codegen.vsApi import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.FirSession -import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol import org.jetbrains.kotlin.fir.caches.FirCache import org.jetbrains.kotlin.fir.caches.createCache import org.jetbrains.kotlin.fir.caches.firCachesFactory @@ -22,7 +22,6 @@ import org.jetbrains.kotlin.fir.deserialization.registeredInSerializationPluginM import org.jetbrains.kotlin.fir.expressions.FirAnnotation import org.jetbrains.kotlin.fir.extensions.FirExtensionSessionComponent import org.jetbrains.kotlin.fir.resolve.fullyExpandedType -import org.jetbrains.kotlin.fir.resolve.toRegularClassSymbol import org.jetbrains.kotlin.fir.scopes.impl.declaredMemberScope import org.jetbrains.kotlin.fir.scopes.processAllProperties import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol @@ -98,7 +97,8 @@ private class FirSerializableProperty( } } -private fun FirBasedSymbol<*>.hasSerialTransient(session: FirSession): Boolean = getSerialTransientAnnotation(session) != null +private fun FirBasedSymbol<*>.hasSerialTransient(session: FirSession): Boolean = + getSerialTransientAnnotation(session) != null private fun FirBasedSymbol<*>.getSerialTransientAnnotation(session: FirSession): FirAnnotation? = getAnnotationByClassId(RpcClassId.serializationTransient, session) @@ -109,8 +109,12 @@ private fun FirClassSymbol<*>.superClassNotAny(session: FirSession): FirRegularC private fun FirClassSymbol<*>.superClassOrAny(session: FirSession): FirRegularClassSymbol { return resolvedSuperTypes.firstNotNullOfOrNull { superType -> - superType.fullyExpandedType(session) - .toRegularClassSymbol(session) - ?.takeIf { it.classKind == ClassKind.CLASS } - } ?: session.builtinTypes.anyType.toRegularClassSymbol(session) ?: error("Symbol for kotlin/Any not found") + vsApi { + superType + .fullyExpandedType(session) + .toRegularClassSymbolVS(session) + }?.takeIf { it.classKind == ClassKind.CLASS } + } + ?: vsApi { session.builtinTypes.anyType.toRegularClassSymbolVS(session) } + ?: error("Symbol for kotlin/Any not found") } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt index 2a7771ad3..ea33c8657 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/latest/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt @@ -6,9 +6,11 @@ package kotlinx.rpc.codegen import org.jetbrains.kotlin.KtSourceElement import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol import org.jetbrains.kotlin.fir.declarations.FirFunction import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.resolve.toClassSymbol +import org.jetbrains.kotlin.fir.resolve.toRegularClassSymbol import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol import org.jetbrains.kotlin.fir.symbols.SymbolInternals import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol @@ -55,4 +57,12 @@ object FirVersionSpecificApiImpl : FirVersionSpecificApi { } override val FirResolvedTypeRef.coneTypeVS: ConeKotlinType get() = coneType + + override fun FirTypeRef.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } + + override fun ConeKotlinType.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt index 72afcf7ff..a89b7c903 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_10/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt @@ -6,6 +6,7 @@ package kotlinx.rpc.codegen import org.jetbrains.kotlin.KtSourceElement import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.types.ConeClassLikeType import org.jetbrains.kotlin.fir.types.ConeKotlinType @@ -21,6 +22,7 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirConstructorSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol +import org.jetbrains.kotlin.fir.types.toRegularClassSymbol object FirVersionSpecificApiImpl : FirVersionSpecificApi { override fun ConeKotlinType.toFirResolvedTypeRefVS( @@ -56,4 +58,12 @@ object FirVersionSpecificApiImpl : FirVersionSpecificApi { } override val FirResolvedTypeRef.coneTypeVS: ConeKotlinType get() = type + + override fun FirTypeRef.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } + + override fun ConeKotlinType.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt index 06b4f6c63..d52bf68c0 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/pre_2_0_21/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt @@ -6,6 +6,7 @@ package kotlinx.rpc.codegen import org.jetbrains.kotlin.KtSourceElement import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.toFirResolvedTypeRef import org.jetbrains.kotlin.fir.types.ConeKotlinType @@ -20,6 +21,7 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirConstructorSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol +import org.jetbrains.kotlin.fir.types.toRegularClassSymbol object FirVersionSpecificApiImpl : FirVersionSpecificApi { override fun ConeKotlinType.toFirResolvedTypeRefVS( @@ -55,4 +57,12 @@ object FirVersionSpecificApiImpl : FirVersionSpecificApi { } override val FirResolvedTypeRef.coneTypeVS: ConeKotlinType get() = type + + override fun FirTypeRef.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } + + override fun ConeKotlinType.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt index 167001fb6..989ff638b 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt @@ -6,9 +6,11 @@ package kotlinx.rpc.codegen import org.jetbrains.kotlin.KtSourceElement import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol import org.jetbrains.kotlin.fir.declarations.declaredFunctions import org.jetbrains.kotlin.fir.declarations.constructors import org.jetbrains.kotlin.fir.resolve.toClassSymbol +import org.jetbrains.kotlin.fir.resolve.toRegularClassSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.toFirResolvedTypeRef import org.jetbrains.kotlin.fir.types.ConeKotlinType @@ -57,4 +59,12 @@ object FirVersionSpecificApiImpl : FirVersionSpecificApi { } override val FirResolvedTypeRef.coneTypeVS: ConeKotlinType get() = coneType + + override fun FirTypeRef.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } + + override fun ConeKotlinType.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt index 167001fb6..989ff638b 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/FirVersionSpecificApiImpl.kt @@ -6,9 +6,11 @@ package kotlinx.rpc.codegen import org.jetbrains.kotlin.KtSourceElement import org.jetbrains.kotlin.fir.FirSession +import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol import org.jetbrains.kotlin.fir.declarations.declaredFunctions import org.jetbrains.kotlin.fir.declarations.constructors import org.jetbrains.kotlin.fir.resolve.toClassSymbol +import org.jetbrains.kotlin.fir.resolve.toRegularClassSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.toFirResolvedTypeRef import org.jetbrains.kotlin.fir.types.ConeKotlinType @@ -57,4 +59,12 @@ object FirVersionSpecificApiImpl : FirVersionSpecificApi { } override val FirResolvedTypeRef.coneTypeVS: ConeKotlinType get() = coneType + + override fun FirTypeRef.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } + + override fun ConeKotlinType.toRegularClassSymbolVS(session: FirSession): FirRegularClassSymbol? { + return toRegularClassSymbol(session) + } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/checkers/diagnostics/DiagnosticFactories.kt b/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/checkers/diagnostics/DiagnosticFactories.kt deleted file mode 100644 index 84e3750cf..000000000 --- a/compiler-plugin/compiler-plugin-k2/src/main/v_2_2_2/kotlinx/rpc/codegen/checkers/diagnostics/DiagnosticFactories.kt +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2023-2025 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.codegen.checkers.diagnostics - -import kotlinx.rpc.codegen.StrictMode -import org.jetbrains.kotlin.diagnostics.KtDiagnosticFactory0 -import org.jetbrains.kotlin.diagnostics.KtDiagnosticsContainer -import org.jetbrains.kotlin.diagnostics.Severity -import org.jetbrains.kotlin.diagnostics.SourceElementPositioningStrategies -import org.jetbrains.kotlin.utils.DummyDelegate -import kotlin.properties.ReadOnlyProperty -import kotlin.reflect.KClass -import kotlin.reflect.KProperty - -context(container: KtDiagnosticsContainer) -inline fun modded0(mode: StrictMode): DiagnosticFactory0DelegateProviderOnNull { - return DiagnosticFactory0DelegateProviderOnNull(mode, T::class, container) -} - -class DiagnosticFactory0DelegateProviderOnNull( - private val mode: StrictMode, - private val psiType: KClass<*>, - private val container: KtDiagnosticsContainer, -) { - operator fun provideDelegate( - @Suppress("unused") - thisRef: Any?, - prop: KProperty<*>, - ): ReadOnlyProperty { - val severity = when (mode) { - StrictMode.ERROR -> Severity.ERROR - StrictMode.WARNING -> Severity.WARNING - StrictMode.NONE -> null - } ?: return DummyDelegate(null) - - return DummyDelegate( - KtDiagnosticFactory0( - name = prop.name, - severity = severity, - defaultPositioningStrategy = SourceElementPositioningStrategies.DEFAULT, - psiType = psiType, - rendererFactory = container.getRendererFactory(), - ), - ) - } -} diff --git a/krpc/krpc-test/build.gradle.kts b/krpc/krpc-test/build.gradle.kts index ba1b5a810..f559f01fa 100644 --- a/krpc/krpc-test/build.gradle.kts +++ b/krpc/krpc-test/build.gradle.kts @@ -2,7 +2,6 @@ * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. */ -import kotlinx.rpc.RpcStrictMode import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode import org.jetbrains.kotlin.gradle.targets.js.testing.KotlinJsTest import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest diff --git a/versions-root/libs.versions.toml b/versions-root/libs.versions.toml index f84ececbf..f12aa3363 100644 --- a/versions-root/libs.versions.toml +++ b/versions-root/libs.versions.toml @@ -4,7 +4,7 @@ kotlinx-rpc = "0.8.0-SNAPSHOT" # kotlin kotlin-lang = "2.1.21" # or env.KOTLIN_VERSION -kotlin-compiler = "0.0.0" # default to kotlin-lang or env.KOTLIN_COMPILER_VERSION +kotlin-compiler = "2.0.21" # default to kotlin-lang or env.KOTLIN_COMPILER_VERSION # kotlin independent versions detekt-analyzer = "1.23.6"