diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt index 3061edb0d..2c307ba01 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcDeclarationScanner.kt @@ -11,7 +11,6 @@ import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.ir.declarations.IrDeclaration import org.jetbrains.kotlin.ir.declarations.IrProperty import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction -import org.jetbrains.kotlin.ir.types.classOrNull import org.jetbrains.kotlin.ir.util.dumpKotlinLike /** @@ -47,16 +46,10 @@ internal object RpcDeclarationScanner { return@memoryOptimizedMap null } - val symbol = declaration.getter!!.returnType.classOrNull - - val flowType = when (symbol) { - ctx.flow -> ServiceDeclaration.FlowField.Kind.Plain - ctx.sharedFlow -> ServiceDeclaration.FlowField.Kind.Shared - ctx.stateFlow -> ServiceDeclaration.FlowField.Kind.State - else -> return@memoryOptimizedMap unsupportedDeclaration(service, declaration, logger) - } - - ServiceDeclaration.FlowField(declaration, flowType) + error( + "Fields are not supported in @Rpc services, this error should be caught by frontend. " + + "Please report this issue to the kotlinx-rpc maintainers." + ) } is IrClass -> { @@ -80,8 +73,7 @@ internal object RpcDeclarationScanner { return ServiceDeclaration( service = service, stubClass = stubClassNotNull, - methods = declarations.filterIsInstance(), - fields = declarations.filterIsInstance(), + methods = declarations.filterNotNull(), ) } } 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 9ba01c84f..961d5ebc0 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 @@ -10,7 +10,6 @@ import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction 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.classOrNull import org.jetbrains.kotlin.ir.types.makeNullable import org.jetbrains.kotlin.ir.util.functions import org.jetbrains.kotlin.ir.util.isVararg @@ -45,18 +44,6 @@ internal class RpcIrContext( getIrClassSymbol("kotlin.reflect", "KType") } - val lazy by lazy { - getIrClassSymbol("kotlin", "Lazy") - } - - val function0 by lazy { - getIrClassSymbol("kotlin", "Function0") - } - - val function1 by lazy { - getIrClassSymbol("kotlin", "Function1") - } - val suspendFunction0 by lazy { getIrClassSymbol("kotlin.coroutines", "SuspendFunction0") } @@ -77,10 +64,6 @@ internal class RpcIrContext( getIrClassSymbol("kotlinx.coroutines.flow", "StateFlow") } - val kProperty1 by lazy { - getIrClassSymbol("kotlin.reflect", "KProperty1") - } - val pair by lazy { getIrClassSymbol("kotlin", "Pair") } @@ -97,10 +80,6 @@ internal class RpcIrContext( getRpcIrClassSymbol("WithServiceDescriptor", "internal") } - val rpcEagerFieldAnnotation by lazy { - getRpcIrClassSymbol("RpcEagerField") - } - val rpcServiceDescriptor by lazy { getRpcIrClassSymbol("RpcServiceDescriptor", "descriptor") } @@ -121,10 +100,6 @@ internal class RpcIrContext( rpcInvokator.subClass("Method") } - val rpcInvokatorField by lazy { - rpcInvokator.subClass("Field") - } - val rpcParameter by lazy { getRpcIrClassSymbol("RpcParameter", "descriptor") } @@ -133,10 +108,6 @@ internal class RpcIrContext( getRpcIrClassSymbol("RpcDeferredField", "internal") } - val fieldDataObject by lazy { - getRpcIrClassSymbol("FieldDataObject", "internal") - } - val rpcMethodClass by lazy { getRpcIrClassSymbol("RpcMethodClass", "internal") } @@ -156,18 +127,6 @@ internal class RpcIrContext( val functions = Functions() inner class Functions { - val registerPlainFlowField by lazy { - namedFunction("kotlinx.rpc", "registerPlainFlowField") - } - - val registerSharedFlowField by lazy { - namedFunction("kotlinx.rpc", "registerSharedFlowField") - } - - val registerStateFlowField by lazy { - namedFunction("kotlinx.rpc", "registerStateFlowField") - } - val dataCast by lazy { namedFunction("kotlinx.rpc.internal", "rpcInternalDataCast") } @@ -200,30 +159,6 @@ internal class RpcIrContext( namedFunction("kotlinx.rpc.internal", "scopedClientCall") } - val lazy by lazy { - namedFunction("kotlin", "lazy") { - vsApi { - it.owner.valueParametersVS().size == 1 - } - } - } - - val lazyGetValue by lazy { - namedFunction("kotlin", "getValue") { - vsApi { - it.owner.extensionReceiverParameterVS?.type?.classOrNull == this@RpcIrContext.lazy - } - } - } - - val listOf by lazy { - namedFunction("kotlin.collections", "listOf") { - vsApi { - it.owner.valueParametersVS().singleOrNull()?.isVararg ?: false - } - } - } - val emptyList by lazy { namedFunction("kotlin.collections", "emptyList") } 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 fd46efe84..a4afd53d0 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 @@ -27,7 +27,6 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames import org.jetbrains.kotlin.types.Variance import org.jetbrains.kotlin.util.OperatorNameConventions -import org.jetbrains.kotlin.utils.memoryOptimizedPlus import kotlin.properties.Delegates private object Stub { @@ -123,10 +122,6 @@ internal class RpcStubGenerator( clientProperty() coroutineContextProperty() - - declaration.fields.forEach { - rpcFlowField(it) - } } private var stubIdProperty: IrProperty by Delegates.notNull() @@ -254,249 +249,6 @@ internal class RpcStubGenerator( } } - /** - * RPC fields. - * Can be of two kinds: Lazy and Eager (defined by `@RpcEagerField` annotation) - * - * Lazy: - * ``` kotlin - * final override val : by lazy { - * client.registerFlowField( - * serviceScope = this, // CoroutineScope - * descriptor = Companion, - * fieldName = "", - * serviceId = __rpc_stub_id, - * ) - * } - * ``` - * - * - * Eager: - * ```kotlin - * final override val : = - * client.registerFlowField( - * serviceScope = this, // CoroutineScope - * descriptor = Companion, - * fieldName = "", - * serviceId = __rpc_stub_id, - * ) - * ``` - * - * Where: - * - `` - the name of the RPC field - * - `` - actual type of the field. Can be either Flot, SharedFlow or StateFlow - * - `` - [ServiceDeclaration.FlowField.Kind] - */ - @Suppress( - "detekt.NestedBlockDepth", - "detekt.LongMethod", - "detekt.CyclomaticComplexMethod", - ) - private fun IrClass.rpcFlowField(field: ServiceDeclaration.FlowField) { - val isLazy = !field.property.hasAnnotation(ctx.rpcEagerFieldAnnotation) - - val servicePropertyGetter = field.property.getterOrFail - - addProperty { - name = field.property.name - visibility = field.property.visibility - modality = Modality.FINAL - isDelegated = isLazy - }.apply { - val fieldProperty = this - - overriddenSymbols = listOf(field.property.symbol) - - val fieldType = servicePropertyGetter.returnType - - val fieldTypeParameter = (fieldType as IrSimpleType).arguments.single() - - val registerFunction = when (field.flowKind) { - ServiceDeclaration.FlowField.Kind.Plain -> ctx.functions.registerPlainFlowField - ServiceDeclaration.FlowField.Kind.Shared -> ctx.functions.registerSharedFlowField - ServiceDeclaration.FlowField.Kind.State -> ctx.functions.registerStateFlowField - } - - val registerCall = vsApi { - IrCallImplVS( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = fieldType, - symbol = registerFunction, - typeArgumentsCount = 1, - valueArgumentsCount = 4, - ) - }.apply { - arguments { - extensionReceiver = irCallProperty(stubClass, clientProperty) - - types { - +fieldTypeParameter.typeOrFail - } - - values { - +IrGetValueImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = ctx.coroutineScope.defaultType, - symbol = stubClassThisReceiver.symbol, - ) - - +irGetDescriptor() - - +stringConst(field.property.name.asString()) - - +irCallProperty(stubClass, stubIdProperty) - } - } - } - - if (!isLazy) { - addBackingFieldUtil { - type = fieldType - visibility = DescriptorVisibilities.PRIVATE - vsApi { isFinalVS = true } - }.apply { - initializer = factory.createExpressionBody(registerCall) - } - - addDefaultGetter(this@rpcFlowField, ctx.irBuiltIns) { - visibility = field.property.visibility - overriddenSymbols = listOf(servicePropertyGetter.symbol) - } - } else { - val lazyFieldType = ctx.lazy.typeWith(fieldType) - - val lazyField = addBackingFieldUtil { - origin = IrDeclarationOrigin.PROPERTY_DELEGATE - name = propertyDelegateName(this@apply.name) - visibility = DescriptorVisibilities.PRIVATE - type = lazyFieldType - vsApi { isFinalVS = true } - }.apply { - val propertyDelegate = this - - // initializer for Lazy delegate with lambda - // inside lambda - 'registerCall' expression is used - initializer = factory.createExpressionBody( - vsApi { - IrCallImplVS( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = lazyFieldType, - symbol = ctx.functions.lazy, - typeArgumentsCount = 1, - valueArgumentsCount = 1, - ) - }.apply { - val lambdaType = ctx.function0.typeWith(fieldType) - - val lambdaFunction = factory.buildFun { - origin = IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA - name = SpecialNames.ANONYMOUS - visibility = DescriptorVisibilities.LOCAL - returnType = fieldType - }.apply { - parent = propertyDelegate - - body = irBuilder(symbol).irBlockBody { - +irReturn(registerCall) - } - } - - val lambda = IrFunctionExpressionImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = lambdaType, - origin = IrStatementOrigin.LAMBDA, - function = lambdaFunction, - ) - - arguments { - types { - +fieldType - } - - values { - +lambda - } - } - } - ) - } - - // Invocation of `operator fun getValue(thisRef: Any?, property: KProperty<*>): T` for delegates - addGetter { - origin = IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR - visibility = this@apply.visibility - returnType = fieldType - }.apply { - val propertyGetter = this - - overriddenSymbols = listOf(servicePropertyGetter.symbol) - - val getterThisReceiver = vsApi { - stubClassThisReceiver.copyToVS(propertyGetter, origin = IrDeclarationOrigin.DEFINED) - }.also { - vsApi { - dispatchReceiverParameterVS = it - } - } - - body = irBuilder(symbol).irBlockBody { - +irReturn( - irCall( - type = fieldType, - callee = ctx.functions.lazyGetValue, - typeArgumentsCount = 1, - ).apply { - arguments { - types { - +fieldType - } - - extensionReceiver = IrGetFieldImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - symbol = lazyField.symbol, - type = lazyFieldType, - receiver = IrGetValueImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = stubClass.defaultType, - symbol = getterThisReceiver.symbol, - ), - ) - - values { - +IrGetValueImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = stubClass.defaultType, - symbol = getterThisReceiver.symbol, - ) - - +IrPropertyReferenceImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = ctx.kProperty1.typeWith(stubClass.defaultType, fieldType), - symbol = fieldProperty.symbol, - typeArgumentsCount = 0, - field = null, - getter = propertyGetter.symbol, - setter = null, - origin = IrStatementOrigin.PROPERTY_REFERENCE_FOR_DELEGATE, - ) - } - } - } - ) - } - } - } - } - } - private fun IrClass.generateMethods() { declaration.methods.forEach { generateRpcMethod(it) @@ -1008,7 +760,7 @@ internal class RpcStubGenerator( private val invokators = mutableMapOf() private fun IrClass.generateInvokators() { - (declaration.methods memoryOptimizedPlus declaration.fields).forEachIndexed { i, callable -> + declaration.methods.forEachIndexed { i, callable -> generateInvokator(i, callable) } } @@ -1055,12 +807,7 @@ internal class RpcStubGenerator( name = Name.identifier("${callable.name}Invokator") visibility = DescriptorVisibilities.PRIVATE }.apply { - val propertyTypeSymbol = when (callable) { - is ServiceDeclaration.Method -> ctx.rpcInvokatorMethod - is ServiceDeclaration.FlowField -> ctx.rpcInvokatorField - } - - val propertyType = propertyTypeSymbol.typeWith(declaration.serviceType) + val propertyType = ctx.rpcInvokatorMethod.typeWith(declaration.serviceType) addBackingFieldUtil { visibility = DescriptorVisibilities.PRIVATE @@ -1133,14 +880,6 @@ internal class RpcStubGenerator( } } } - - is ServiceDeclaration.FlowField -> { - irCall(callable.property.getterOrFail).apply { - arguments { - dispatchReceiver = irGet(serviceParameter) - } - } - } } +irReturn(call) @@ -1153,11 +892,6 @@ internal class RpcStubGenerator( ctx.anyNullable, // data ctx.anyNullable, // returnType ) - - is ServiceDeclaration.FlowField -> ctx.function1.typeWith( - declaration.serviceType, // service - ctx.anyNullable, // returnType - ) } val lambda = IrFunctionExpressionImpl( @@ -1220,7 +954,7 @@ internal class RpcStubGenerator( vsApi { isFinalVS = true } visibility = DescriptorVisibilities.PRIVATE }.apply { - val isEmpty = declaration.methods.isEmpty() && declaration.fields.isEmpty() + val isEmpty = declaration.methods.isEmpty() initializer = factory.createExpressionBody( vsApi { @@ -1248,7 +982,7 @@ internal class RpcStubGenerator( val varargType = ctx.irBuiltIns.arrayClass.typeWith(pairType, Variance.OUT_VARIANCE) - val callables = declaration.methods memoryOptimizedPlus declaration.fields + val callables = declaration.methods val vararg = IrVarargImpl( startOffset = UNDEFINED_OFFSET, @@ -1347,28 +1081,22 @@ internal class RpcStubGenerator( val dataType = when (callable) { is ServiceDeclaration.Method -> methodClasses[i].defaultType - is ServiceDeclaration.FlowField -> ctx.fieldDataObject.defaultType } - val returnType = when (callable) { - is ServiceDeclaration.Method -> when { - callable.function.isNonSuspendingWithFlowReturn() -> { - (callable.function.returnType as IrSimpleType).arguments.single().typeOrFail - } - - else -> { - callable.function.returnType - } + val returnType = when { + callable.function.isNonSuspendingWithFlowReturn() -> { + (callable.function.returnType as IrSimpleType).arguments.single().typeOrFail } - is ServiceDeclaration.FlowField -> callable.property.getterOrFail.returnType + else -> { + callable.function.returnType + } } val invokator = invokators[callable.name] ?: error("Expected invokator for ${callable.name} in ${declaration.service.name}") - val parameters = (callable as? ServiceDeclaration.Method)?.arguments - ?: emptyList() + val parameters = callable.arguments val callee = if (parameters.isEmpty()) { ctx.functions.emptyArray @@ -1449,7 +1177,7 @@ internal class RpcStubGenerator( +arrayOfCall - +booleanConst(callable is ServiceDeclaration.Method && !callable.function.isSuspend) + +booleanConst(!callable.function.isSuspend) } } } @@ -1597,47 +1325,21 @@ internal class RpcStubGenerator( .copyToVS(this@apply, origin = IrDeclarationOrigin.DEFINED) } - val service = addValueParameter { + addValueParameter { name = Name.identifier("service") type = declaration.serviceType } body = irBuilder(symbol).irBlockBody { - val isEmpty = declaration.fields.isEmpty() - val anyListType = ctx.irBuiltIns.listClass.typeWith(ctx.anyNullable) val listCall = irCall( - callee = if (isEmpty) ctx.functions.emptyList else ctx.functions.listOf, + callee = ctx.functions.emptyList, type = anyListType, ).apply listApply@{ - if (isEmpty) { - arguments { - types { +ctx.anyNullable } - } - - return@listApply - } - - val vararg = IrVarargImpl( - startOffset = UNDEFINED_OFFSET, - endOffset = UNDEFINED_OFFSET, - type = ctx.arrayOfAnyNullable, - varargElementType = ctx.anyNullable, - elements = declaration.fields.memoryOptimizedMap { - irCallProperty(irGet(service), it.property) - } - ) - arguments { - types { - +ctx.anyNullable - } - - values { - +vararg + types { +ctx.anyNullable } } - } } +irReturn(irAs(listCall, listType)) diff --git a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/ServiceDeclaration.kt b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/ServiceDeclaration.kt index 3c3dce74a..0af4fd2f6 100644 --- a/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/ServiceDeclaration.kt +++ b/compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/ServiceDeclaration.kt @@ -16,7 +16,6 @@ class ServiceDeclaration( val service: IrClass, val stubClass: IrClass, val methods: List, - val fields: List, ) { val fqName = service.kotlinFqName.asString() @@ -37,15 +36,4 @@ class ServiceDeclaration( val type: IrType, ) } - - class FlowField( - val property: IrProperty, - val flowKind: Kind, - ) : Callable { - override val name: String = property.name.asString() - - enum class Kind { - Plain, Shared, State; - } - } } diff --git a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/StrictMode.kt b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/StrictMode.kt index b8e4ca918..6f4b45ef3 100644 --- a/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/StrictMode.kt +++ b/compiler-plugin/compiler-plugin-k2/src/main/core/kotlinx/rpc/codegen/StrictMode.kt @@ -111,15 +111,15 @@ object StrictModeCliOptions { val FIELDS = CliOption( optionName = "strict-fields", valueDescription = VALUE_DESCRIPTION, - description = description("fields"), + description = description("fields", deprecated = true), required = false, allowMultipleOccurrences = false, ) const val VALUE_DESCRIPTION = "none, warning or error" - fun description(entity: String): String { - return "Diagnostic level for $entity in @Rpc services." + fun description(entity: String, deprecated: Boolean = false): String { + return "Diagnostic level for $entity in @Rpc services." + if (deprecated) " Deprecated." else "" } val configurationMapper = mapOf( diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/RpcClient.kt b/core/src/commonMain/kotlin/kotlinx/rpc/RpcClient.kt index e1630a573..5e6073320 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/RpcClient.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/RpcClient.kt @@ -39,7 +39,8 @@ public interface RpcClient : CoroutineScope { */ @Deprecated( "This method was primarily used for fields in RPC services, which are now deprecated. " + - "See https://kotlin.github.io/kotlinx-rpc/strict-mode.html fields guide for more information" + "See https://kotlin.github.io/kotlinx-rpc/strict-mode.html fields guide for more information", + level = DeprecationLevel.ERROR, ) public fun callAsync(serviceScope: CoroutineScope, call: RpcCall): Deferred diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/RpcEagerField.kt b/core/src/commonMain/kotlin/kotlinx/rpc/RpcEagerField.kt index 9f68337c7..2709b21ad 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/RpcEagerField.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/RpcEagerField.kt @@ -10,9 +10,7 @@ package kotlinx.rpc @Target(AnnotationTarget.PROPERTY) @Deprecated( "Fields are deprecated, see https://kotlin.github.io/kotlinx-rpc/0-5-0.html", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) public annotation class RpcEagerField -@Deprecated("Use RpcEagerField instead", ReplaceWith("RpcEagerField"), level = DeprecationLevel.ERROR) -public typealias RPCEagerField = RpcEagerField diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/awaitFieldInitialization.kt b/core/src/commonMain/kotlin/kotlinx/rpc/awaitFieldInitialization.kt index 3a93aef0d..9e5931822 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/awaitFieldInitialization.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/awaitFieldInitialization.kt @@ -29,7 +29,7 @@ import kotlin.reflect.KClass */ @Deprecated( "Fields are deprecated, see https://kotlin.github.io/kotlinx-rpc/0-5-0.html", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) public suspend fun <@Rpc T : Any, R> T.awaitFieldInitialization(getter: T.() -> R): R { val field = getter() @@ -60,12 +60,13 @@ public suspend fun <@Rpc T : Any, R> T.awaitFieldInitialization(getter: T.() -> * @param T service type * @return specified service, after all of it's field were initialized. */ +@Suppress("RedundantSuspendModifier") @Deprecated( "Fields are deprecated, see https://kotlin.github.io/kotlinx-rpc/0-5-0.html", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) public suspend inline fun <@Rpc reified T : Any> T.awaitFieldInitialization(): T { - return awaitFieldInitialization(T::class) + error("Fields are deprecated, see https://kotlin.github.io/kotlinx-rpc/0-5-0.html") } /** @@ -89,7 +90,7 @@ public suspend inline fun <@Rpc reified T : Any> T.awaitFieldInitialization(): T */ @Deprecated( "Fields are deprecated, see https://kotlin.github.io/kotlinx-rpc/0-5-0.html", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) public suspend fun <@Rpc T : Any> T.awaitFieldInitialization(kClass: KClass): T { serviceDescriptorOf(kClass) diff --git a/core/src/commonMain/kotlin/kotlinx/rpc/registerField.kt b/core/src/commonMain/kotlin/kotlinx/rpc/registerField.kt index 74f5b3987..e4e6aeaa7 100644 --- a/core/src/commonMain/kotlin/kotlinx/rpc/registerField.kt +++ b/core/src/commonMain/kotlin/kotlinx/rpc/registerField.kt @@ -10,7 +10,6 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharedFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.rpc.descriptor.RpcServiceDescriptor -import kotlinx.rpc.internal.FieldDataObject import kotlinx.rpc.internal.RpcFlow /** @@ -27,7 +26,7 @@ import kotlinx.rpc.internal.RpcFlow */ @Deprecated( "Fields are deprecated, see https://kotlin.github.io/kotlinx-rpc/0-5-0.html", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) public fun RpcClient.registerPlainFlowField( serviceScope: CoroutineScope, @@ -52,7 +51,7 @@ public fun RpcClient.registerPlainFlowField( */ @Deprecated( "Fields are deprecated, see https://kotlin.github.io/kotlinx-rpc/0-5-0.html", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) public fun RpcClient.registerSharedFlowField( serviceScope: CoroutineScope, @@ -77,7 +76,7 @@ public fun RpcClient.registerSharedFlowField( */ @Deprecated( "Fields are deprecated, see https://kotlin.github.io/kotlinx-rpc/0-5-0.html", - level = DeprecationLevel.WARNING, + level = DeprecationLevel.ERROR, ) public fun RpcClient.registerStateFlowField( serviceScope: CoroutineScope, @@ -88,11 +87,12 @@ public fun RpcClient.registerStateFlowField( return RpcFlow.State(descriptor.fqName, initializeFlowField(serviceScope, descriptor, fieldName, serviceId)) } +@Suppress("unused", "UnusedReceiverParameter") private fun > RpcClient.initializeFlowField( serviceScope: CoroutineScope, descriptor: RpcServiceDescriptor<*>, fieldName: String, serviceId: Long, ): Deferred { - return callAsync(serviceScope, RpcCall(descriptor, fieldName, FieldDataObject, serviceId)) + error("Fields are deprecated, see https://kotlin.github.io/kotlinx-rpc/0-5-0.html") } diff --git a/gradle-plugin/src/main/kotlin/kotlinx/rpc/Extensions.kt b/gradle-plugin/src/main/kotlin/kotlinx/rpc/Extensions.kt index c64ed04a0..b03cf0fd6 100644 --- a/gradle-plugin/src/main/kotlin/kotlinx/rpc/Extensions.kt +++ b/gradle-plugin/src/main/kotlin/kotlinx/rpc/Extensions.kt @@ -88,6 +88,7 @@ open class RpcStrictModeExtension @Inject constructor(objects: ObjectFactory) { * * Consider using regular streaming. */ + @Deprecated("Field are deprecated with level ERROR. This option can't change it.") val fields: Property = objects.strictModeProperty() private fun ObjectFactory.strictModeProperty( 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 ac23ea832..d27ab2caa 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 @@ -115,30 +115,6 @@ interface KrpcTestService : RemoteService { fun unitFlow(): Flow - val plainFlowOfInts : Flow - - val plainFlowOfFlowsOfInts : Flow> - - val plainFlowOfFlowsOfFlowsOfInts : Flow>> - - val sharedFlowOfInts : SharedFlow - - val sharedFlowOfFlowsOfInts : SharedFlow> - - val sharedFlowOfFlowsOfFlowsOfInts : SharedFlow>> - - val stateFlowOfInts : StateFlow - - val stateFlowOfFlowsOfInts : StateFlow> - - val stateFlowOfFlowsOfFlowsOfInts : StateFlow>> - - suspend fun emitNextForStateFlowOfInts(value: Int) - - suspend fun emitNextForStateFlowOfFlowsOfInts(value: Int) - - suspend fun emitNextForStateFlowOfFlowsOfFlowsOfInts(value: Int) - suspend fun sharedFlowInFunction(sharedFlow: SharedFlow): StateFlow suspend fun stateFlowInFunction(stateFlow: StateFlow): StateFlow 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 014fc62d6..45b107c46 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 @@ -288,45 +288,6 @@ class KrpcTestServiceBackend(override val coroutineContext: CoroutineContext) : } } - override val plainFlowOfInts: Flow = plainFlow { it } - - override val plainFlowOfFlowsOfInts: Flow> = plainFlow { plainFlow { i -> i } } - - override val plainFlowOfFlowsOfFlowsOfInts: Flow>> = plainFlow { plainFlow { plainFlow { i -> i } } } - - override val sharedFlowOfInts: SharedFlow = - sharedFlowOfT { it } - - override val sharedFlowOfFlowsOfInts: SharedFlow> = - sharedFlowOfT { sharedFlowOfT { it } } - - override val sharedFlowOfFlowsOfFlowsOfInts: SharedFlow>> = - sharedFlowOfT { sharedFlowOfT { sharedFlowOfT { it } } } - - override val stateFlowOfInts: MutableStateFlow = - stateFlowOfT { it } - - override val stateFlowOfFlowsOfInts: MutableStateFlow> = - stateFlowOfT { stateFlowOfT { it } } - - override val stateFlowOfFlowsOfFlowsOfInts: MutableStateFlow>> = - stateFlowOfT { stateFlowOfT { stateFlowOfT { it } } } - - override suspend fun emitNextForStateFlowOfInts(value: Int) { - stateFlowOfInts.emit(value) - } - - override suspend fun emitNextForStateFlowOfFlowsOfInts(value: Int) { - stateFlowOfFlowsOfInts.value.emit(value) - stateFlowOfFlowsOfInts.emit(MutableStateFlow(value)) - } - - override suspend fun emitNextForStateFlowOfFlowsOfFlowsOfInts(value: Int) { - stateFlowOfFlowsOfFlowsOfInts.value.value.emit(value) - stateFlowOfFlowsOfFlowsOfInts.value.emit(MutableStateFlow(value)) - stateFlowOfFlowsOfFlowsOfInts.emit(MutableStateFlow(MutableStateFlow(value))) - } - override suspend fun sharedFlowInFunction(sharedFlow: SharedFlow): StateFlow { val state = MutableStateFlow(-1) 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 a994cf08e..38ef3c36d 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 @@ -574,106 +574,6 @@ abstract class KrpcTransportTestBase { assertEquals(Unit, client.unitFlow().toList().single()) } - @Test - fun testPlainFlowOfInts() = runTest { - val flow = client.plainFlowOfInts.toList() - assertEquals(List(5) { it }, flow) - } - - @Test - fun testPlainFlowOfFlowsOfInts() = runTest { - val lists = client.plainFlowOfFlowsOfInts.map { - it.toList() - }.toList() - - assertEquals(List(5) { List(5) { it } }, lists) - } - - @Test - fun testPlainFlowOfFlowsOfFlowsOfInts() = runTest { - val lists = client.plainFlowOfFlowsOfFlowsOfInts.map { - it.map { i -> i.toList() }.toList() - }.toList() - - assertEquals(List(5) { List(5) { List(5) { it } } }, lists) - } - - @Test - fun testSharedFlowOfInts() = runTest { - val list1 = client.sharedFlowOfInts.take(5).toList() - val list2 = client.sharedFlowOfInts.take(3).toList() - - assertEquals(List(5) { it }, list1) - assertEquals(List(3) { it }, list2) - } - - @Test - fun testSharedFlowOfFlowsOfInts() = runTest { - val list1 = client.sharedFlowOfFlowsOfInts.take(5).map { - it.take(5).toList() - }.toList() - - val list2 = client.sharedFlowOfFlowsOfInts.take(3).map { - it.take(3).toList() - }.toList() - - assertEquals(List(5) { List(5) { it } }, list1) - assertEquals(List(3) { List(3) { it } }, list2) - } - - @Test - fun testSharedFlowOfFlowsOfFlowsOfInts() = runTest { - val list1 = client.sharedFlowOfFlowsOfFlowsOfInts.take(5).map { - it.take(5).map { i -> i.take(5).toList() }.toList() - }.toList() - - val list2 = client.sharedFlowOfFlowsOfFlowsOfInts.take(3).map { - it.take(3).map { i -> i.take(3).toList() }.toList() - }.toList() - - assertEquals(List(5) { List(5) { List(5) { it } } }, list1) - assertEquals(List(3) { List(3) { List(3) { it } } }, list2) - } - - @Test - fun testStateFlowOfInts() = runTest { - val flow = client.awaitFieldInitialization { stateFlowOfInts } - - assertEquals(-1, flow.value) - - client.emitNextForStateFlowOfInts(42) - - assertEquals(42, flow.first { it == 42 }) - } - - @Test - fun testStateFlowOfFlowsOfInts() = runTest { - val flow1 = client.awaitFieldInitialization { stateFlowOfFlowsOfInts } - val flow2 = flow1.value - - assertEquals(-1, flow2.value) - - client.emitNextForStateFlowOfFlowsOfInts(42) - - assertEquals(42, flow2.first { it == 42 }) - assertEquals(42, flow1.first { it.value == 42 }.value) - } - - @Test - fun testStateFlowOfFlowsOfFlowsOfInts() = runTest { - val flow1 = client.awaitFieldInitialization { stateFlowOfFlowsOfFlowsOfInts } - val flow2 = flow1.value - val flow3 = flow2.value - - assertEquals(-1, flow3.value) - - client.emitNextForStateFlowOfFlowsOfFlowsOfInts(42) - - assertEquals(42, flow3.first { it == 42 }) - assertEquals(42, flow2.first { it.value == 42 }.value) - assertEquals(42, flow1.first { it.value.value == 42 }.value.value) - } - @Test fun testSharedFlowInFunction() = runTest { streamScoped { @@ -698,15 +598,6 @@ abstract class KrpcTransportTestBase { } } - @Test - fun testAwaitAllFields() = runTest { - with(client.awaitFieldInitialization()) { - assertEquals(-1, stateFlowOfInts.value) - assertEquals(-1, stateFlowOfFlowsOfInts.value.value) - assertEquals(-1, stateFlowOfFlowsOfFlowsOfInts.value.value.value) - } - } - companion object { fun expectedPayloadWithPayload(size: Int) = List(size) { listOf("a$it", "b$it", "c$it") } } diff --git a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/SamplingService.kt b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/SamplingService.kt index 54267498e..738e5d371 100644 --- a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/SamplingService.kt +++ b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/SamplingService.kt @@ -35,14 +35,6 @@ interface SamplingService : RemoteService { suspend fun serverNestedFlow(): Flow> suspend fun callException() - - val plainFlow: Flow - - val sharedFlow: SharedFlow - - val stateFlow: StateFlow - - suspend fun emitNextInStateFlow(next: Int) } class SamplingServiceImpl(override val coroutineContext: CoroutineContext) : SamplingService { @@ -69,18 +61,4 @@ class SamplingServiceImpl(override val coroutineContext: CoroutineContext) : Sam override suspend fun callException() { error("Server exception") } - - override val plainFlow: Flow = plainFlow { it } - - override val sharedFlow: SharedFlow = sharedFlowOfT { it } - - override val stateFlow: MutableStateFlow = stateFlowOfT { it } - - override suspend fun emitNextInStateFlow(next: Int) { - launch { - // CallSuccess and StreamMessage may race, so we prevent this - delay(500) - stateFlow.value = next - } - } } diff --git a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationService.kt b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationService.kt index 5bed4e894..2dd950b06 100644 --- a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationService.kt +++ b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationService.kt @@ -34,10 +34,6 @@ interface CancellationService : RemoteService { suspend fun incomingHotFlow(): StateFlow - val fastFieldFlow: Flow - - val slowFieldFlow: Flow - suspend fun closedStreamScopeCallback() suspend fun closedStreamScopeCallbackWithStream(): Flow @@ -133,14 +129,6 @@ class CancellationServiceImpl(override val coroutineContext: CoroutineContext) : return state } - override val fastFieldFlow: Flow = resumableFlow(fence) - - val emittedFromSlowField = mutableListOf() - - override val slowFieldFlow: Flow = resumableFlow(fence) { - emittedFromSlowField.add(it) - } - val streamScopeCallbackResult = CompletableDeferred() override suspend fun closedStreamScopeCallback() { diff --git a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationTest.kt b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationTest.kt index d30d7d667..00f82b701 100644 --- a/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationTest.kt +++ b/krpc/krpc-test/src/commonTest/kotlin/kotlinx/rpc/krpc/test/cancellation/CancellationTest.kt @@ -447,44 +447,6 @@ class CancellationTest { stopAllAndJoin() } - @Test - fun testFieldFlowWorksWithNoScope() = runCancellationTest { - val result = service.fastFieldFlow - - serverInstance().fence.complete(Unit) - - assertContentEquals(List(2) { it }, result.toList()) - - stopAllAndJoin() - } - - @Test - fun testServiceCancellationCancelsFieldFlow() = runCancellationTest { - val flow = service.slowFieldFlow - val firstCollected = CompletableDeferred() - val allCollected = mutableListOf() - - val job = launch { - flow.collect { - allCollected.add(it) - - if (!firstCollected.isCompleted) { - firstCollected.complete(it) - } - } - } - - firstCollected.await() - - service.cancel("Service cancelled") - - job.join() - assertContentEquals(listOf(0), allCollected) - assertContentEquals(listOf(0), serverInstance().emittedFromSlowField) - - stopAllAndJoin() - } - @Test fun testInvokeOnStreamScopeCompletionOnServerWithNoStreams() = runCancellationTest { streamScoped { diff --git a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/ApiVersioningTest.kt b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/ApiVersioningTest.kt index 9c0e1fee8..3b9742d41 100644 --- a/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/ApiVersioningTest.kt +++ b/krpc/krpc-test/src/jvmTest/kotlin/kotlinx/rpc/krpc/test/api/ApiVersioningTest.kt @@ -5,9 +5,7 @@ package kotlinx.rpc.krpc.test.api import kotlinx.coroutines.flow.map -import kotlinx.coroutines.flow.take import kotlinx.coroutines.flow.toList -import kotlinx.rpc.awaitFieldInitialization import kotlinx.rpc.krpc.internal.CancellationType import kotlinx.rpc.krpc.internal.KrpcMessage import kotlinx.rpc.krpc.internal.KrpcPlugin @@ -114,47 +112,6 @@ class ApiVersioningTest { } } - @Test - @Ignore("Flow sampling tests are too unstable. Ignored until better fix") - fun testPlainFlowSampling() = wireSamplingTest("plainFlow") { - sample { - val response = plainFlow.toList().joinToString() - val expected = List(5) { it }.joinToString() - - assertEquals(expected, response) - } - } - - @Test - @Ignore("First value in stateFlow and CallSuccess for its initialization have a race") - fun testSharedFlowSampling() = wireSamplingTest("sharedFlow") { - sample { - val response = sharedFlow.take(5).toList().joinToString() - val expected = List(5) { it }.joinToString() - - assertEquals(expected, response) - } - } - - @Test - @Ignore("First value in stateFlow and CallSuccess for its initialization have a race") - fun testStateFlowSampling() = wireSamplingTest("stateFlow") { - sample { - val state = awaitFieldInitialization { stateFlow } - assertEquals(-1, state.value) - - val newFlow = state.take(2) - - newFlow.collect { - when (it) { - -1 -> emitNextInStateFlow(10) - 10 -> assertEquals(10, state.value) - else -> error("Unexpected value in flow: $it") - } - } - } - } - private fun List>.join() = joinToString { "[${it.joinToString()}]" } companion object { diff --git a/tests/compiler-plugin-tests/src/test-gen/kotlinx/rpc/codegen/test/runners/BoxTestGenerated.java b/tests/compiler-plugin-tests/src/test-gen/kotlinx/rpc/codegen/test/runners/BoxTestGenerated.java index 9b0b0c3e5..b204c706c 100644 --- a/tests/compiler-plugin-tests/src/test-gen/kotlinx/rpc/codegen/test/runners/BoxTestGenerated.java +++ b/tests/compiler-plugin-tests/src/test-gen/kotlinx/rpc/codegen/test/runners/BoxTestGenerated.java @@ -27,12 +27,6 @@ public void testCustomParameterTypes() { runTest("src/testData/box/customParameterTypes.kt"); } - @Test - @TestMetadata("fields.kt") - public void testFields() { - runTest("src/testData/box/fields.kt"); - } - @Test @TestMetadata("flowParameter.kt") public void testFlowParameter() { diff --git a/tests/compiler-plugin-tests/src/testData/box/fields.fir.ir.txt b/tests/compiler-plugin-tests/src/testData/box/fields.fir.ir.txt deleted file mode 100644 index 1dab42ad0..000000000 --- a/tests/compiler-plugin-tests/src/testData/box/fields.fir.ir.txt +++ /dev/null @@ -1,591 +0,0 @@ -FILE fqName: fileName:/fields.kt - CLASS INTERFACE name:BoxService modality:ABSTRACT visibility:public superTypes:[kotlinx.rpc.RemoteService] - annotations: - Rpc - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService - CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub - PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final] - EXPRESSION_BODY - GET_VAR '__rpc_stub_id: kotlin.Long declared in .BoxService.$rpcServiceStub.' type=kotlin.Long origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.Long - correspondingProperty: PROPERTY name:__rpc_stub_id visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_stub_id type:kotlin.Long visibility:private [final]' type=kotlin.Long origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - PROPERTY name:__rpc_client visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RpcClient visibility:private [final] - EXPRESSION_BODY - GET_VAR '__rpc_client: kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub.' type=kotlinx.rpc.RpcClient origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.rpc.RpcClient - correspondingProperty: PROPERTY name:__rpc_client visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:__rpc_client type:kotlinx.rpc.RpcClient visibility:private [final]' type=kotlinx.rpc.RpcClient origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient - FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final] - EXPRESSION_BODY - CALL 'public abstract fun provideStubContext (serviceId: kotlin.Long): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RpcClient' type=kotlin.coroutines.CoroutineContext origin=null - $this: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlin.coroutines.CoroutineContext - correspondingProperty: PROPERTY name:coroutineContext visibility:public modality:FINAL [val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in .BoxService - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.coroutines.CoroutineContext declared in .BoxService.$rpcServiceStub' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:coroutineContext type:kotlin.coroutines.CoroutineContext visibility:private [final]' type=kotlin.coroutines.CoroutineContext origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - PROPERTY name:plainFlow visibility:public modality:FINAL [delegated,val] - overridden: - public abstract plainFlow: kotlinx.coroutines.flow.Flow declared in .BoxService - FIELD PROPERTY_DELEGATE name:plainFlow$delegate type:kotlin.Lazy> visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy> origin=null - : kotlinx.coroutines.flow.Flow - initializer: FUN_EXPR type=kotlin.Function0> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlinx.coroutines.flow.Flow - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub.plainFlow$delegate' - CALL 'public final fun registerPlainFlowField (serviceScope: kotlinx.coroutines.CoroutineScope, descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, fieldName: kotlin.String, serviceId: kotlin.Long): kotlinx.coroutines.flow.Flow declared in kotlinx.rpc' type=kotlinx.coroutines.flow.Flow origin=null - : kotlin.String - $receiver: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=kotlinx.coroutines.CoroutineScope origin=null - 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 - fieldName: CONST String type=kotlin.String value="plainFlow" - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.coroutines.flow.Flow - correspondingProperty: PROPERTY name:plainFlow visibility:public modality:FINAL [delegated,val] - overridden: - public abstract fun (): kotlinx.coroutines.flow.Flow declared in .BoxService - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlinx.coroutines.flow.Flow origin=null - : kotlinx.coroutines.flow.Flow - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:plainFlow$delegate type:kotlin.Lazy> visibility:private [final] declared in .BoxService.$rpcServiceStub' type=kotlin.Lazy> origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - thisRef: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - property: PROPERTY_REFERENCE 'public final plainFlow: kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub' field=null getter='public final fun (): kotlinx.coroutines.flow.Flow declared in .BoxService.$rpcServiceStub' setter=null type=kotlin.reflect.KProperty1<.BoxService.$rpcServiceStub, kotlinx.coroutines.flow.Flow> origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:sharedFlow visibility:public modality:FINAL [delegated,val] - overridden: - public abstract sharedFlow: kotlinx.coroutines.flow.SharedFlow declared in .BoxService - FIELD PROPERTY_DELEGATE name:sharedFlow$delegate type:kotlin.Lazy> visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy> origin=null - : kotlinx.coroutines.flow.SharedFlow - initializer: FUN_EXPR type=kotlin.Function0> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlinx.coroutines.flow.SharedFlow - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService.$rpcServiceStub.sharedFlow$delegate' - CALL 'public final fun registerSharedFlowField (serviceScope: kotlinx.coroutines.CoroutineScope, descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, fieldName: kotlin.String, serviceId: kotlin.Long): kotlinx.coroutines.flow.SharedFlow declared in kotlinx.rpc' type=kotlinx.coroutines.flow.SharedFlow origin=null - : kotlin.String - $receiver: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=kotlinx.coroutines.CoroutineScope origin=null - 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 - fieldName: CONST String type=kotlin.String value="sharedFlow" - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.coroutines.flow.SharedFlow - correspondingProperty: PROPERTY name:sharedFlow visibility:public modality:FINAL [delegated,val] - overridden: - public abstract fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService.$rpcServiceStub' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlinx.coroutines.flow.SharedFlow origin=null - : kotlinx.coroutines.flow.SharedFlow - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:sharedFlow$delegate type:kotlin.Lazy> visibility:private [final] declared in .BoxService.$rpcServiceStub' type=kotlin.Lazy> origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - thisRef: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - property: PROPERTY_REFERENCE 'public final sharedFlow: kotlinx.coroutines.flow.SharedFlow declared in .BoxService.$rpcServiceStub' field=null getter='public final fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService.$rpcServiceStub' setter=null type=kotlin.reflect.KProperty1<.BoxService.$rpcServiceStub, kotlinx.coroutines.flow.SharedFlow> origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:stateFlow visibility:public modality:FINAL [delegated,val] - overridden: - public abstract stateFlow: kotlinx.coroutines.flow.StateFlow declared in .BoxService - FIELD PROPERTY_DELEGATE name:stateFlow$delegate type:kotlin.Lazy> visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy> origin=null - : kotlinx.coroutines.flow.StateFlow - initializer: FUN_EXPR type=kotlin.Function0> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlinx.coroutines.flow.StateFlow - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService.$rpcServiceStub.stateFlow$delegate' - CALL 'public final fun registerStateFlowField (serviceScope: kotlinx.coroutines.CoroutineScope, descriptor: kotlinx.rpc.descriptor.RpcServiceDescriptor<*>, fieldName: kotlin.String, serviceId: kotlin.Long): kotlinx.coroutines.flow.StateFlow declared in kotlinx.rpc' type=kotlinx.coroutines.flow.StateFlow origin=null - : kotlin.String - $receiver: CALL 'private final fun (): kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub' type=kotlinx.rpc.RpcClient origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - serviceScope: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=kotlinx.coroutines.CoroutineScope origin=null - 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 - fieldName: CONST String type=kotlin.String value="stateFlow" - serviceId: CALL 'private final fun (): kotlin.Long declared in .BoxService.$rpcServiceStub' type=kotlin.Long origin=GET_PROPERTY - $this: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub) returnType:kotlinx.coroutines.flow.StateFlow - correspondingProperty: PROPERTY name:stateFlow visibility:public modality:FINAL [delegated,val] - overridden: - public abstract fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService.$rpcServiceStub' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlinx.coroutines.flow.StateFlow origin=null - : kotlinx.coroutines.flow.StateFlow - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:stateFlow$delegate type:kotlin.Lazy> visibility:private [final] declared in .BoxService.$rpcServiceStub' type=kotlin.Lazy> origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - thisRef: GET_VAR ': .BoxService.$rpcServiceStub declared in .BoxService.$rpcServiceStub.' type=.BoxService.$rpcServiceStub origin=null - property: PROPERTY_REFERENCE 'public final stateFlow: kotlinx.coroutines.flow.StateFlow declared in .BoxService.$rpcServiceStub' field=null getter='public final fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService.$rpcServiceStub' setter=null type=kotlin.reflect.KProperty1<.BoxService.$rpcServiceStub, kotlinx.coroutines.flow.StateFlow> origin=PROPERTY_REFERENCE_FOR_DELEGATE - CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.BoxService.$rpcServiceStub.Companion - PROPERTY name:fqName visibility:public modality:FINAL [val] - overridden: - public abstract fqName: kotlin.String declared in kotlinx.rpc.descriptor.RpcServiceDescriptor - FIELD PROPERTY_BACKING_FIELD name:fqName type:kotlin.String visibility:private [final] - EXPRESSION_BODY - CONST String type=kotlin.String value="BoxService" - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlin.String - correspondingProperty: PROPERTY name:fqName visibility:public modality:FINAL [val] - overridden: - public abstract fun (): kotlin.String declared in kotlinx.rpc.descriptor.RpcServiceDescriptor - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .BoxService.$rpcServiceStub.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:fqName type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null - PROPERTY name:plainFlowInvokator visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:plainFlowInvokator type:kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> visibility:private [final] - EXPRESSION_BODY - TYPE_OP type=kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> origin=SAM_CONVERSION typeOperand=kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> - FUN_EXPR type=kotlin.Function1<.BoxService, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService) returnType:kotlin.Any? - VALUE_PARAMETER name:service index:0 type:.BoxService - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (service: .BoxService): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.plainFlowInvokator' - CALL 'public abstract fun (): kotlinx.coroutines.flow.Flow declared in .BoxService' type=kotlinx.coroutines.flow.Flow origin=null - $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.plainFlowInvokator.' type=.BoxService origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> - correspondingProperty: PROPERTY name:plainFlowInvokator visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:plainFlowInvokator type:kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> visibility:private [final]' type=kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null - PROPERTY name:sharedFlowInvokator visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:sharedFlowInvokator type:kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> visibility:private [final] - EXPRESSION_BODY - TYPE_OP type=kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> origin=SAM_CONVERSION typeOperand=kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> - FUN_EXPR type=kotlin.Function1<.BoxService, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService) returnType:kotlin.Any? - VALUE_PARAMETER name:service index:0 type:.BoxService - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (service: .BoxService): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.sharedFlowInvokator' - CALL 'public abstract fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService' type=kotlinx.coroutines.flow.SharedFlow origin=null - $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.sharedFlowInvokator.' type=.BoxService origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> - correspondingProperty: PROPERTY name:sharedFlowInvokator visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:sharedFlowInvokator type:kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> visibility:private [final]' type=kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null - PROPERTY name:stateFlowInvokator visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:stateFlowInvokator type:kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> visibility:private [final] - EXPRESSION_BODY - TYPE_OP type=kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> origin=SAM_CONVERSION typeOperand=kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> - FUN_EXPR type=kotlin.Function1<.BoxService, kotlin.Any?> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (service:.BoxService) returnType:kotlin.Any? - VALUE_PARAMETER name:service index:0 type:.BoxService - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (service: .BoxService): kotlin.Any? declared in .BoxService.$rpcServiceStub.Companion.stateFlowInvokator' - CALL 'public abstract fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService' type=kotlinx.coroutines.flow.StateFlow origin=null - $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.stateFlowInvokator.' type=.BoxService origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.BoxService.$rpcServiceStub.Companion) returnType:kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> - correspondingProperty: PROPERTY name:stateFlowInvokator visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:stateFlowInvokator type:kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> visibility:private [final]' type=kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null - PROPERTY name:callableMap visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:callableMap type:kotlin.collections.Map.BoxService>> visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun mapOf (vararg pairs: kotlin.Pair): kotlin.collections.Map declared in kotlin.collections' type=kotlin.collections.Map.BoxService>> origin=null - : kotlin.String - : kotlinx.rpc.descriptor.RpcCallable<.BoxService> - pairs: VARARG type=kotlin.Array.BoxService>>> varargElementType=kotlin.Pair.BoxService>> - 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="plainFlow" - 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 - : .BoxService - name: CONST String type=kotlin.String value="plainFlow" - 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 - : kotlinx.rpc.internal.FieldDataObject - returnType: 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 - : kotlinx.coroutines.flow.Flow - invokator: CALL 'private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' type=kotlinx.rpc.descriptor.RpcInvokator.Field<.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 - : kotlinx.rpc.descriptor.RpcParameter - 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="sharedFlow" - 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 - : .BoxService - name: CONST String type=kotlin.String value="sharedFlow" - 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 - : kotlinx.rpc.internal.FieldDataObject - returnType: 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 - : kotlinx.coroutines.flow.SharedFlow - invokator: CALL 'private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' type=kotlinx.rpc.descriptor.RpcInvokator.Field<.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 - : kotlinx.rpc.descriptor.RpcParameter - 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="stateFlow" - 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 - : .BoxService - name: CONST String type=kotlin.String value="stateFlow" - 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 - : kotlinx.rpc.internal.FieldDataObject - returnType: 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 - : kotlinx.coroutines.flow.StateFlow - invokator: CALL 'private final fun (): kotlinx.rpc.descriptor.RpcInvokator.Field<.BoxService> declared in .BoxService.$rpcServiceStub.Companion' type=kotlinx.rpc.descriptor.RpcInvokator.Field<.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 - : kotlinx.rpc.descriptor.RpcParameter - 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] - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.Map.BoxService>> declared in .BoxService.$rpcServiceStub.Companion' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:callableMap type:kotlin.collections.Map.BoxService>> visibility:private [final]' type=kotlin.collections.Map.BoxService>> origin=null - receiver: GET_VAR ': .BoxService.$rpcServiceStub.Companion declared in .BoxService.$rpcServiceStub.Companion.' type=.BoxService.$rpcServiceStub.Companion origin=null - CONSTRUCTOR visibility:private <> () returnType:.BoxService.$rpcServiceStub.Companion [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.FirRpcServiceStubCompanionObject] OBJECT name:Companion modality:FINAL visibility:public [companion] superTypes:[kotlinx.rpc.descriptor.RpcServiceDescriptor<.BoxService>]' 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.rpc.descriptor.RpcServiceDescriptor - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.descriptor.RpcServiceDescriptor - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlinx.rpc.descriptor.RpcServiceDescriptor - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:createInstance visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, serviceId:kotlin.Long, client:kotlinx.rpc.RpcClient) returnType:.BoxService - overridden: - public abstract fun createInstance (serviceId: kotlin.Long, client: kotlinx.rpc.RpcClient): T of kotlinx.rpc.descriptor.RpcServiceDescriptor declared in kotlinx.rpc.descriptor.RpcServiceDescriptor - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion - VALUE_PARAMETER name:serviceId index:0 type:kotlin.Long - VALUE_PARAMETER name:client index:1 type:kotlinx.rpc.RpcClient - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun createInstance (serviceId: kotlin.Long, client: kotlinx.rpc.RpcClient): .BoxService declared in .BoxService.$rpcServiceStub.Companion' - CONSTRUCTOR_CALL 'public constructor (__rpc_stub_id: kotlin.Long, __rpc_client: kotlinx.rpc.RpcClient) declared in .BoxService.$rpcServiceStub' type=.BoxService.$rpcServiceStub origin=null - __rpc_stub_id: GET_VAR 'serviceId: kotlin.Long declared in .BoxService.$rpcServiceStub.Companion.createInstance' type=kotlin.Long origin=null - __rpc_client: GET_VAR 'client: kotlinx.rpc.RpcClient declared in .BoxService.$rpcServiceStub.Companion.createInstance' type=kotlinx.rpc.RpcClient origin=null - FUN name:getCallable visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, name:kotlin.String) returnType:kotlinx.rpc.descriptor.RpcCallable? - overridden: - public abstract fun getCallable (name: kotlin.String): kotlinx.rpc.descriptor.RpcCallable? declared in kotlinx.rpc.descriptor.RpcServiceDescriptor - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion - VALUE_PARAMETER name:name index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getCallable (name: kotlin.String): kotlinx.rpc.descriptor.RpcCallable? declared in .BoxService.$rpcServiceStub.Companion' - CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map' type=kotlinx.rpc.descriptor.RpcCallable? origin=GET_ARRAY_ELEMENT - $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 - FUN name:getFields visibility:public modality:OPEN <> ($this:.BoxService.$rpcServiceStub.Companion, service:.BoxService) returnType:kotlin.collections.List> - overridden: - public abstract fun getFields (service: T of kotlinx.rpc.descriptor.RpcServiceDescriptor): kotlin.collections.List> declared in kotlinx.rpc.descriptor.RpcServiceDescriptor - $this: VALUE_PARAMETER name: type:.BoxService.$rpcServiceStub.Companion - VALUE_PARAMETER name:service index:0 type:.BoxService - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getFields (service: .BoxService): kotlin.collections.List> declared in .BoxService.$rpcServiceStub.Companion' - TYPE_OP type=kotlin.collections.List> origin=CAST typeOperand=kotlin.collections.List> - CALL 'public final fun listOf (vararg elements: T of kotlin.collections.listOf): kotlin.collections.List declared in kotlin.collections' type=kotlin.collections.List origin=null - : kotlin.Any? - elements: VARARG type=kotlin.Array varargElementType=kotlin.Any? - CALL 'public abstract fun (): kotlinx.coroutines.flow.Flow declared in .BoxService' type=kotlinx.coroutines.flow.Flow origin=GET_PROPERTY - $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.getFields' type=.BoxService origin=null - CALL 'public abstract fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService' type=kotlinx.coroutines.flow.SharedFlow origin=GET_PROPERTY - $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.getFields' type=.BoxService origin=null - CALL 'public abstract fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService' type=kotlinx.coroutines.flow.StateFlow origin=GET_PROPERTY - $this: GET_VAR 'service: .BoxService declared in .BoxService.$rpcServiceStub.Companion.getFields' type=.BoxService origin=null - CONSTRUCTOR visibility:public <> (__rpc_stub_id:kotlin.Long, __rpc_client:kotlinx.rpc.RpcClient) returnType:.BoxService.$rpcServiceStub [primary] - VALUE_PARAMETER name:__rpc_stub_id index:0 type:kotlin.Long - VALUE_PARAMETER name:__rpc_client index:1 type:kotlinx.rpc.RpcClient - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS GENERATED[kotlinx.rpc.codegen.RpcGeneratedStubKey] CLASS name:$rpcServiceStub modality:FINAL visibility:public superTypes:[.BoxService]' 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 .BoxService - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .BoxService - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .BoxService - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlinx.rpc.RemoteService - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlinx.rpc.RemoteService - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlinx.rpc.RemoteService - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract coroutineContext: kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:kotlinx.rpc.RemoteService) returnType:kotlin.coroutines.CoroutineContext [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:coroutineContext visibility:public modality:ABSTRACT [fake_override,val] - overridden: - public abstract fun (): kotlin.coroutines.CoroutineContext declared in kotlinx.rpc.RemoteService - $this: VALUE_PARAMETER name: type:kotlinx.rpc.RemoteService - PROPERTY name:plainFlow visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlinx.coroutines.flow.Flow - correspondingProperty: PROPERTY name:plainFlow visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.BoxService - PROPERTY name:sharedFlow visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlinx.coroutines.flow.SharedFlow - correspondingProperty: PROPERTY name:sharedFlow visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.BoxService - PROPERTY name:stateFlow visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.BoxService) returnType:kotlinx.coroutines.flow.StateFlow - correspondingProperty: PROPERTY name:stateFlow visibility:public modality:ABSTRACT [val] - $this: VALUE_PARAMETER name: type:.BoxService - FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' - CALL 'public final fun runBlocking (context: kotlin.coroutines.CoroutineContext, block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): T of kotlinx.coroutines.runBlocking declared in kotlinx.coroutines' type=kotlin.String origin=null - : kotlin.String - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlinx.coroutines.CoroutineScope) returnType:kotlin.String [suspend] - $receiver: VALUE_PARAMETER name:$this$runBlocking type:kotlinx.coroutines.CoroutineScope - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box' - BLOCK type=kotlin.String origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.String? [val] - CALL 'public final fun withTimeoutOrNull (timeMillis: kotlin.Long, block: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): T of kotlinx.coroutines.withTimeoutOrNull? declared in kotlinx.coroutines' type=kotlin.String? origin=null - : kotlin.String - timeMillis: CONST Long type=kotlin.Long value=1000 - block: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlinx.coroutines.CoroutineScope) returnType:kotlin.String [suspend] - $receiver: VALUE_PARAMETER name:$this$withTimeoutOrNull type:kotlinx.coroutines.CoroutineScope - BLOCK_BODY - VAR name:plainFlow type:kotlin.collections.List [val] - CALL 'public final fun toList (destination: kotlin.collections.MutableList): kotlin.collections.List declared in kotlinx.coroutines.flow' type=kotlin.collections.List origin=null - : kotlin.String - $receiver: CALL 'public abstract fun (): kotlinx.coroutines.flow.Flow declared in .BoxService' type=kotlinx.coroutines.flow.Flow origin=GET_PROPERTY - $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null - : .BoxService - $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RpcClient]' type=kotlinx.rpc.codegen.test.TestRpcClient - VAR name:sharedFlow type:kotlin.collections.List [val] - CALL 'public final fun toList (destination: kotlin.collections.MutableList): kotlin.collections.List declared in kotlinx.coroutines.flow' type=kotlin.collections.List origin=null - : kotlin.String - $receiver: CALL 'public final fun take (count: kotlin.Int): kotlinx.coroutines.flow.Flow declared in kotlinx.coroutines.flow' type=kotlinx.coroutines.flow.Flow origin=null - : kotlin.String - $receiver: CALL 'public abstract fun (): kotlinx.coroutines.flow.SharedFlow declared in .BoxService' type=kotlinx.coroutines.flow.SharedFlow origin=GET_PROPERTY - $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null - : .BoxService - $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RpcClient]' type=kotlinx.rpc.codegen.test.TestRpcClient - count: CONST Int type=kotlin.Int value=1 - VAR name:stateFlow type:kotlin.String [val] - CALL 'public abstract fun (): T of kotlinx.coroutines.flow.StateFlow declared in kotlinx.coroutines.flow.StateFlow' type=kotlin.String origin=GET_PROPERTY - $this: CALL 'public abstract fun (): kotlinx.coroutines.flow.StateFlow declared in .BoxService' type=kotlinx.coroutines.flow.StateFlow origin=GET_PROPERTY - $this: CALL 'public final fun withService (): T of kotlinx.rpc.withService declared in kotlinx.rpc' type=.BoxService origin=null - : .BoxService - $receiver: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:TestRpcClient modality:FINAL visibility:public superTypes:[kotlinx.rpc.RpcClient]' type=kotlinx.rpc.codegen.test.TestRpcClient - VAR name:failures type:kotlin.collections.MutableList [val] - CALL 'public final fun mutableListOf (): kotlin.collections.MutableList declared in kotlin.collections' type=kotlin.collections.MutableList origin=null - : kotlin.String - WHEN type=kotlin.Unit origin=IF - BRANCH - if: WHEN type=kotlin.Boolean origin=OROR - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'val plainFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null - arg1: CONST Int type=kotlin.Int value=1 - then: CONST Boolean type=kotlin.Boolean value=true - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: CALL 'public abstract fun get (index: kotlin.Int): E of kotlin.collections.List declared in kotlin.collections.List' type=kotlin.String origin=GET_ARRAY_ELEMENT - $this: GET_VAR 'val plainFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null - index: CONST Int type=kotlin.Int value=0 - arg1: CONST String type=kotlin.String value="registerPlainFlowField_42" - then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Boolean origin=null - CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null - $this: GET_VAR 'val failures: kotlin.collections.MutableList declared in .box..' type=kotlin.collections.MutableList origin=null - element: STRING_CONCATENATION type=kotlin.String - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="plainFlow.size = " - CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'val plainFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null - CONST String type=kotlin.String value=" (expected 1), " - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="plainFlow[0] = \"" - CALL 'public final fun getOrNull (index: kotlin.Int): T of kotlin.collections.getOrNull? declared in kotlin.collections' type=kotlin.String? origin=null - : kotlin.String - $receiver: GET_VAR 'val plainFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null - index: CONST Int type=kotlin.Int value=0 - CONST String type=kotlin.String value="\" (expected \"registerPlainFlowField_42\")" - WHEN type=kotlin.Unit origin=IF - BRANCH - if: WHEN type=kotlin.Boolean origin=OROR - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'val sharedFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null - arg1: CONST Int type=kotlin.Int value=1 - then: CONST Boolean type=kotlin.Boolean value=true - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: CALL 'public abstract fun get (index: kotlin.Int): E of kotlin.collections.List declared in kotlin.collections.List' type=kotlin.String origin=GET_ARRAY_ELEMENT - $this: GET_VAR 'val sharedFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null - index: CONST Int type=kotlin.Int value=0 - arg1: CONST String type=kotlin.String value="registerSharedFlowField_42" - then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Boolean origin=null - CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null - $this: GET_VAR 'val failures: kotlin.collections.MutableList declared in .box..' type=kotlin.collections.MutableList origin=null - element: STRING_CONCATENATION type=kotlin.String - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="sharedFlow.size = " - CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.List' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'val sharedFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null - CONST String type=kotlin.String value=" (expected 1), " - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="sharedFlow[0] = \"" - CALL 'public final fun getOrNull (index: kotlin.Int): T of kotlin.collections.getOrNull? declared in kotlin.collections' type=kotlin.String? origin=null - : kotlin.String - $receiver: GET_VAR 'val sharedFlow: kotlin.collections.List declared in .box..' type=kotlin.collections.List origin=null - index: CONST Int type=kotlin.Int value=0 - CONST String type=kotlin.String value="\" (expected \"registerSharedFlowField_42\")" - WHEN type=kotlin.Unit origin=IF - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_VAR 'val stateFlow: kotlin.String declared in .box..' type=kotlin.String origin=null - arg1: CONST String type=kotlin.String value="registerStateFlowField_42" - then: TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit - BLOCK type=kotlin.Boolean origin=null - CALL 'public abstract fun add (element: E of kotlin.collections.MutableList): kotlin.Boolean declared in kotlin.collections.MutableList' type=kotlin.Boolean origin=null - $this: GET_VAR 'val failures: kotlin.collections.MutableList declared in .box..' type=kotlin.collections.MutableList origin=null - element: STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="stateFlow = \"" - GET_VAR 'val stateFlow: kotlin.String declared in .box..' type=kotlin.String origin=null - CONST String type=kotlin.String value="\" (expected \"registerStateFlowField_42\")" - RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .box.' - BLOCK type=kotlin.String origin=ELVIS - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.String? [val] - BLOCK type=kotlin.String? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.String? [val] - BLOCK type=kotlin.String? origin=SAFE_CALL - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.MutableList? [val] - CALL 'public final fun takeIf (predicate: kotlin.Function1): T of kotlin.takeIf? declared in kotlin' type=kotlin.collections.MutableList? origin=null - : kotlin.collections.MutableList - $receiver: GET_VAR 'val failures: kotlin.collections.MutableList declared in .box..' type=kotlin.collections.MutableList origin=null - predicate: FUN_EXPR type=kotlin.Function1, kotlin.Boolean> origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.collections.MutableList) returnType:kotlin.Boolean - VALUE_PARAMETER name:it index:0 type:kotlin.collections.MutableList - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (it: kotlin.collections.MutableList): kotlin.Boolean declared in .box..' - CALL 'public final fun isNotEmpty (): kotlin.Boolean declared in kotlin.collections' type=kotlin.Boolean origin=null - : kotlin.String - $receiver: GET_VAR 'it: kotlin.collections.MutableList declared in .box...' type=kotlin.collections.MutableList origin=null - WHEN type=kotlin.String? origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_3: kotlin.collections.MutableList? declared in .box..' type=kotlin.collections.MutableList? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun joinToString (separator: kotlin.CharSequence, prefix: kotlin.CharSequence, postfix: kotlin.CharSequence, limit: kotlin.Int, truncated: kotlin.CharSequence, transform: kotlin.Function1?): kotlin.String declared in kotlin.collections' type=kotlin.String origin=null - : kotlin.String - $receiver: GET_VAR 'val tmp_3: kotlin.collections.MutableList? declared in .box..' type=kotlin.collections.MutableList? origin=null - separator: CONST String type=kotlin.String value=";" - WHEN type=kotlin.String? origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_2: kotlin.String? declared in .box..' type=kotlin.String? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST Null type=kotlin.Nothing? value=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CALL 'public final fun let (block: kotlin.Function1): R of kotlin.let declared in kotlin' type=kotlin.String origin=null - : kotlin.String - : kotlin.String - $receiver: GET_VAR 'val tmp_2: kotlin.String? declared in .box..' type=kotlin.String? origin=null - block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.String - VALUE_PARAMETER name:it index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (it: kotlin.String): kotlin.String declared in .box..' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="Fail: " - GET_VAR 'it: kotlin.String declared in .box...' type=kotlin.String origin=null - WHEN type=kotlin.String origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_1: kotlin.String? declared in .box..' type=kotlin.String? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST String type=kotlin.String value="OK" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_1: kotlin.String? declared in .box..' type=kotlin.String? origin=null - WHEN type=kotlin.String origin=null - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'val tmp_0: kotlin.String? declared in .box.' type=kotlin.String? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: CONST String type=kotlin.String value="Fail: test timed out" - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'val tmp_0: kotlin.String? declared in .box.' type=kotlin.String? origin=null diff --git a/tests/compiler-plugin-tests/src/testData/box/fields.fir.txt b/tests/compiler-plugin-tests/src/testData/box/fields.fir.txt deleted file mode 100644 index 26699a18d..000000000 --- a/tests/compiler-plugin-tests/src/testData/box/fields.fir.txt +++ /dev/null @@ -1,55 +0,0 @@ -FILE: fields.kt - @R|kotlinx/rpc/annotations/Rpc|() public abstract interface BoxService : R|kotlinx/rpc/RemoteService| { - public abstract val plainFlow: R|kotlinx/coroutines/flow/Flow| - public get(): R|kotlinx/coroutines/flow/Flow| - - public abstract val sharedFlow: R|kotlinx/coroutines/flow/SharedFlow| - public get(): R|kotlinx/coroutines/flow/SharedFlow| - - public abstract val stateFlow: R|kotlinx/coroutines/flow/StateFlow| - public get(): R|kotlinx/coroutines/flow/StateFlow| - - public final class $rpcServiceStub : R|kotlin/Any| { - public final companion object Companion : R|kotlin/Any| { - } - - } - - } - public final fun box(): R|kotlin/String| { - ^box R|kotlinx/coroutines/runBlocking|( = runBlocking@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/String| { - ^ R|kotlinx/coroutines/withTimeoutOrNull|(Long(1000), = withTimeoutOrNull@fun R|kotlinx/coroutines/CoroutineScope|.(): R|kotlin/String| { - lval plainFlow: R|kotlin/collections/List| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.plainFlow|.R|kotlinx/coroutines/flow/toList|() - lval sharedFlow: R|kotlin/collections/List| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.sharedFlow|.R|kotlinx/coroutines/flow/take|(Int(1)).R|kotlinx/coroutines/flow/toList|() - lval stateFlow: R|kotlin/String| = Q|kotlinx/rpc/codegen/test/TestRpcClient|.R|kotlinx/rpc/withService|().R|/BoxService.stateFlow|.R|SubstitutionOverride| - lval failures: R|kotlin/collections/MutableList| = R|kotlin/collections/mutableListOf|() - when () { - !=(R|/plainFlow|.R|SubstitutionOverride|, Int(1)) || !=(R|/plainFlow|.R|SubstitutionOverride|(Int(0)), String(registerPlainFlowField_42)) -> { - R|/failures|.R|SubstitutionOverride|(((String(plainFlow.size = ), R|/plainFlow|.R|SubstitutionOverride|, String( (expected 1), )), (String(plainFlow[0] = ), String("), R|/plainFlow|.R|kotlin/collections/getOrNull|(Int(0)), String("), String( (expected ), String("), String(registerPlainFlowField_42), String("), String())))) - } - } - - when () { - !=(R|/sharedFlow|.R|SubstitutionOverride|, Int(1)) || !=(R|/sharedFlow|.R|SubstitutionOverride|(Int(0)), String(registerSharedFlowField_42)) -> { - R|/failures|.R|SubstitutionOverride|(((String(sharedFlow.size = ), R|/sharedFlow|.R|SubstitutionOverride|, String( (expected 1), )), (String(sharedFlow[0] = ), String("), R|/sharedFlow|.R|kotlin/collections/getOrNull|(Int(0)), String("), String( (expected ), String("), String(registerSharedFlowField_42), String("), String())))) - } - } - - when () { - !=(R|/stateFlow|, String(registerStateFlowField_42)) -> { - R|/failures|.R|SubstitutionOverride|((String(stateFlow = ), String("), R|/stateFlow|, String("), String( (expected ), String("), String(registerStateFlowField_42), String("), String()))) - } - } - - ^ R|/failures|.R|kotlin/takeIf||>( = takeIf@fun (it: R|kotlin/collections/MutableList|): R|kotlin/Boolean| { - ^ R|/it|.R|kotlin/collections/isNotEmpty|() - } - )?.{ $subj$.R|kotlin/collections/joinToString|(String(;)) }?.{ $subj$.R|kotlin/let|( = let@fun (it: R|kotlin/String|): R|kotlin/String| { - ^ (String(Fail: ), R|/it|) - } - ) } ?: String(OK) - } - ) ?: String(Fail: test timed out) - } - ) - } diff --git a/tests/compiler-plugin-tests/src/testData/box/fields.kt b/tests/compiler-plugin-tests/src/testData/box/fields.kt deleted file mode 100644 index 59fd99ec0..000000000 --- a/tests/compiler-plugin-tests/src/testData/box/fields.kt +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. - */ - -import kotlinx.coroutines.* -import kotlinx.coroutines.flow.* -import kotlinx.rpc.RemoteService -import kotlinx.rpc.withService -import kotlinx.rpc.annotations.Rpc -import kotlinx.rpc.codegen.test.TestRpcClient - -@Rpc -interface BoxService : RemoteService { - val plainFlow: Flow - - val sharedFlow: SharedFlow - - val stateFlow: StateFlow -} - -fun box(): String = runBlocking { - withTimeoutOrNull(1000) { - val plainFlow = TestRpcClient.withService().plainFlow.toList() - val sharedFlow = TestRpcClient.withService().sharedFlow.take(1).toList() - val stateFlow = TestRpcClient.withService().stateFlow.value - - val failures = mutableListOf() - - if (plainFlow.size != 1 || plainFlow[0] != "registerPlainFlowField_42") { - failures.add( - "plainFlow.size = ${plainFlow.size} (expected 1), " + - "plainFlow[0] = \"${plainFlow.getOrNull(0)}\" (expected \"registerPlainFlowField_42\")" - ) - } - - if (sharedFlow.size != 1 || sharedFlow[0] != "registerSharedFlowField_42") { - failures.add( - "sharedFlow.size = ${sharedFlow.size} (expected 1), " + - "sharedFlow[0] = \"${sharedFlow.getOrNull(0)}\" (expected \"registerSharedFlowField_42\")" - ) - } - - if (stateFlow != "registerStateFlowField_42") { - failures.add("stateFlow = \"$stateFlow\" (expected \"registerStateFlowField_42\")") - } - - failures.takeIf { it.isNotEmpty() } - ?.joinToString(";") - ?.let { "Fail: $it" } - ?: "OK" - } ?: "Fail: test timed out" -} diff --git a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.kt b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.kt index 08770caae..1069d5392 100644 --- a/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.kt +++ b/tests/compiler-plugin-tests/src/testData/diagnostics/rpcChecked.kt @@ -29,11 +29,11 @@ inline suspend fun <@Rpc reified T : Any> ok(client: RpcClient, server: RpcServe server.registerService { MyServiceImpl(it) } server.registerService { impl } - myServiceImpl.awaitFieldInitialization() - myServiceImpl.awaitFieldInitialization { 1 } + myServiceImpl.awaitFieldInitialization() + myServiceImpl.awaitFieldInitialization { 1 } - impl.awaitFieldInitialization() - impl.awaitFieldInitialization { 1 } + impl.awaitFieldInitialization() + impl.awaitFieldInitialization { 1 } serviceDescriptorOf() serviceDescriptorOf() @@ -48,14 +48,14 @@ inline suspend fun fail(client: RpcClient, server: RpcServer, server.registerService<NotAService> { NotAService(it) } server.registerService<T> { impl } - myServiceImpl.awaitFieldInitialization<MyServiceImpl>() - myServiceImpl.awaitFieldInitialization<MyServiceImpl, Int> { 1 } + myServiceImpl.awaitFieldInitialization<MyServiceImpl>() + myServiceImpl.awaitFieldInitialization<MyServiceImpl, Int> { 1 } - notAServiceImpl.awaitFieldInitialization<NotAService>() - notAServiceImpl.awaitFieldInitialization<NotAService, Int> { 1 } + notAServiceImpl.awaitFieldInitialization<NotAService>() + notAServiceImpl.awaitFieldInitialization<NotAService, Int> { 1 } - impl.awaitFieldInitialization<T>() - impl.awaitFieldInitialization<T, Int> { 1 } + impl.awaitFieldInitialization<T>() + impl.awaitFieldInitialization<T, Int> { 1 } serviceDescriptorOf<MyServiceImpl>() serviceDescriptorOf<NotAService>()