Skip to content

Commit 94f0705

Browse files
committed
Update IR plugin to the latest library version
1 parent 6c4a4a2 commit 94f0705

File tree

9 files changed

+145
-149
lines changed

9 files changed

+145
-149
lines changed

compiler-plugin/compiler-plugin-core/src/main/kotlin/kotlinx/rpc/codegen/extension/RPCIrContext.kt

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@ internal class RPCIrContext(
2828
irBuiltIns.anyType.makeNullable()
2929
}
3030

31-
val optInAnnotation by lazy {
32-
getIrClassSymbol("kotlin", "OptIn")
33-
}
34-
35-
val extensionFunctionType by lazy {
36-
getIrClassSymbol("kotlin", "ExtensionFunctionType")
37-
}
38-
3931
val coroutineScope by lazy {
4032
getIrClassSymbol("kotlinx.coroutines", "CoroutineScope")
4133
}
@@ -44,10 +36,6 @@ internal class RPCIrContext(
4436
getIrClassSymbol("kotlin.coroutines", "CoroutineContext")
4537
}
4638

47-
val completableJob by lazy {
48-
getIrClassSymbol("kotlinx.coroutines", "CompletableJob")
49-
}
50-
5139
val kTypeClass by lazy {
5240
getIrClassSymbol("kotlin.reflect", "KType")
5341
}
@@ -60,8 +48,8 @@ internal class RPCIrContext(
6048
getIrClassSymbol("kotlin", "Function0")
6149
}
6250

63-
val suspendFunction1 by lazy {
64-
getIrClassSymbol("kotlin.coroutines", "SuspendFunction1")
51+
val suspendFunction0 by lazy {
52+
getIrClassSymbol("kotlin.coroutines", "SuspendFunction0")
6553
}
6654

6755
val flow by lazy {
@@ -153,10 +141,18 @@ internal class RPCIrContext(
153141
rpcClient.namedFunction("call")
154142
}
155143

144+
val provideStubContext by lazy {
145+
rpcClient.namedFunction("provideStubContext")
146+
}
147+
156148
val typeOf by lazy {
157149
namedFunction("kotlin.reflect", "typeOf")
158150
}
159151

152+
val scopedClientCall by lazy {
153+
namedFunction("kotlinx.rpc.internal", "scopedClientCall")
154+
}
155+
160156
val lazy by lazy {
161157
namedFunction("kotlin", "lazy") {
162158
it.owner.valueParameters.size == 1
@@ -197,14 +193,6 @@ internal class RPCIrContext(
197193
namedFunction("kotlin", "to")
198194
}
199195

200-
val withContext by lazy {
201-
namedFunction("kotlinx.coroutines", "withContext")
202-
}
203-
204-
val job by lazy {
205-
namedFunction("kotlinx.coroutines", "Job")
206-
}
207-
208196
private fun IrClassSymbol.namedFunction(name: String): IrSimpleFunction {
209197
return owner.functions.single { it.name.asString() == name }
210198
}

compiler-plugin/compiler-plugin-core/src/main/kotlin/kotlinx/rpc/codegen/extension/RPCIrServiceProcessor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ internal class RPCIrServiceProcessor(
1919
@Suppress("PARAMETER_NAME_CHANGED_ON_OVERRIDE")
2020
override fun visitClass(declaration: IrClass, context: RPCIrContext): IrStatement {
2121
if (declaration.isInterface &&
22-
// data.rpc is resolved lazily, so first check is rather heuristic
22+
// context.rpc is resolved lazily, so first check is rather heuristic
2323
declaration.maybeRPC() &&
2424
declaration.superTypes.contains(context.rpc.typeWith())
2525
) {

0 commit comments

Comments
 (0)